use Term::ReadLine;
use lib 'modules';
use Class::Prototyped;
use strict;
use warnings;
use threads;
use threads::shared;
use Data::Dumper;
$Data::Dumper::Useqq = 1;
$Data::Dumper::Terse = 1;
$Data::Dumper::Indent = 1;
our $o;
my $parentlink = {};
#Object: BootObject
$o = Class::Prototyped->new();
my $jaddSlot = sub { my $self = shift;
              my $method = shift; my $val = shift;
              eval{
              unless ($val){$val=Dumper($val);};
   
              $self->reflect->addSlot([$method,,description=>$val]=>eval($val));
              };
              return $self;};         
              $o->reflect->addSlot(jaddSlot=>$jaddSlot);
              #Fields:
$o->jaddSlot("i_am_a" => "\"BootObject\"");
$o->jaddSlot("objects" => "\{\}");
$o->jaddSlot("initialiser" => "\{\
\ \ \"dummy_method\"\ \=\>\ \"method\"\
\}");
$o->jaddSlot("age" => "340");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("jclone" => "undef");
$o->jaddSlot("delete_objects_by_name" => "\{\}");
$o->jaddSlot("oblist" => "\[\]");
$o->jaddSlot("default_shutdown" => "undef");
$o->jaddSlot("isApplication" => "0");
$o->jaddSlot("documentation" => "\"\=head1\ NAME\ BootObject\ \-\ Handles\ system\ startup\\n\\n\=head1\ ABSTRACT\\nBootObject\ contains\ all\ the\ routines\ needed\ to\ start\ and\ shutdown\ the\ system\.\ \ It\ also\ keeps\ track\ of\ the\\nprototypes\ in\ the\ system\.\ \ It\ is\ the\ parent\ of\ every\ \(persistent\)\ object\.\\n\\n\=head1\ USE\\n\\n\"");
$o->jaddSlot("autoApplication" => "undef");
$o->jaddSlot("serial_number" => "19");
#Methods: 
$o->jaddSlot("load" => "sub{require \$_[1]}");
$o->jaddSlot("objsearch" => "sub{\n\t#print \"Searching for \$_[1]\\n\";\n\tforeach my \$k (keys %{\$_[0]->objects})\n      {\n\t\t\tmy \$obj = \$_[0]->objects->{\$k};\n\t\t\tmy \$o_name = \$obj->i_am_a;\n\t\t\t#print \"Comparing \$o_name with \$_[1].\\n\";\n\t\t\tif ( \$o_name eq \$_[1]) \n\t\t\t\t{return \$obj;}\n\n\t\t}\n\t\t\n\treturn undef;}");
$o->jaddSlot("sersearch" => "sub {\n  #print \"Searching for \$_[1]\\n\";\n\tforeach my \$obj (\@{\$_[0]->oblist})\n      {\n    #print Dumper(\$obj);\n\t\t\tmy \$o_num = \$obj->serial_number;\n\t\t\t#print \"Comparing \$o_num with \$_[1].\\n\";\n\t\t\tif ( \$o_num == \$_[1]) \n\t\t\t\t{return \$obj;}\n\t\t}\n\t\t\n\treturn undef;\n  };");
$o->jaddSlot("register" => "sub {\n    my \$l = \$_[0]->oblist;\n    push \@{\$l}, \$_[0];\n    \$_[0]->oblist(\$l);\n    my \$h = \$_[0]->objects;\n    \$h->{\$_[0]}=\$_[0];\n    \$_[0]->objects(\$h)};");
$o->jaddSlot("update" => "sub{}");
$o->jaddSlot("sclone" => "sub {my \$self=shift;my \$new=\$self->clone(\@_);\n  \$self->register;\n    \$new->register;\n    #foreach my \$method ( keys %{\$i} )\n    #  {\$new->reflect->addSlot(\$method=>eval{\$i->{\$method}});}\n      return \$new;\n    }");
$o->jaddSlot("jaddSlots" => "sub {\n  my \$self=shift;\n  my %slots = \@_;\n  foreach my \$key ( keys %slots )\n    {\n      \$self->jaddSlot(\$key, \$slots{\$key});\n    }\n  }");
$o->jaddSlot("tagline" => "sub{return \"I contain all the methods needed to boostrap the system\"}");
$o->jaddSlot("duplicate" => "sub {my \$self=shift;\nmy \$new=\$self->clone(\@_);\n    \$new->register;\nmy \$old_name = \$new->i_am_a;\n\$new->i_am_a(\"Clone of \".\$old_name);\n      return \$new;\n    }\n");
$o->jaddSlot("start_graphics" => "sub{\$_[0]->find(\"GuiMenu\")->go;}\n");
$o->jaddSlot("gui" => "sub{ \$_[0]->find(\"GuiMenu\")->go}\n");
$o->jaddSlot("fresh" => "sub {my \$o = Class::Prototyped->new(\"bootStrap*\" => shift);\n\$o->register;\n\$o->jaddSlot(tagline => q*sub{return \"I need a tagline\"}*);\n\$o->jaddSlot(i_am_a => q*sub{return \"NewObject\"}*);\nreturn \$o;}\n");
$o->jaddSlot("prima" => "sub{ \$_[0]->find(\"PrimaMenu\")->go}\n\n");
$o->jaddSlot("startup" => "sub{  \n  }");
$o->jaddSlot("shutdown" => "sub{\n\n}");
$o->jaddSlot("serialise" => "sub\n    {\n      #print \"Serialising...\\n\";\n      my \$self=shift;\n      my \$ret;\n   \n      \$ret .= \"#Object: \". \$self->i_am_a.\"\\n\";\n      \n         if (\$self eq \$self->bootObj)\n           {\n             \$ret .= \"\\\$o = Class::Prototyped->new();\\n\";\n             \$ret .= 'my \$jaddSlot = sub { my \$self = shift;\n              my \$method = shift; my \$val = shift;\n              eval{\n              unless (\$val){\$val=Dumper(\$val);};\n   \n              \$self->reflect->addSlot([\$method,,description=>\$val]=>eval(\$val));\n              };\n              return \$self;};         \n              \$o->reflect->addSlot(jaddSlot=>\$jaddSlot);\n              ';\n             }\n        else\n           {\$ret .= '\$o = \$bootObj->fresh;'.\"\\n\";}\n        \n\t\tmy \$par_nums = {};\n\t\t\$self->default_shutdown;\n\t\t\$ret .= \$self->serialise_fields();\n\t\t\$ret .= \"#Methods: \\n\";\n        foreach my \$method (\$self->reflect->slotNames('METHOD'))\n         {\n           next if (\$method =~ /\\*\$/);\n           my (\$val, \$slot) = \$self->reflect->getSlot(\$method,\"rotated\");\n           if (\$slot){\n          \n           my \$attr = \$slot->{attribs};\n           my \$data = Dumper(\$attr->{description});\n           chomp \$data;\n\t\t\tmy \$target = \$attr->{description};\n\t\t\tif (ref(\$target) =~ /PKG/ ) \n\t\t\t\t{\n\t\t\t\t\t\$data = \"undef\"\t;\n\t\t\t\t\tprint \"Processing stadard attribute link\\n\";\n\t\t\t\t\tprint \"Looking at object: \".\$self->i_am_a.\".\\n\";\n\t\t  \t\t\t#print Dumper(\$target);\n\t\t\t\t\tmy \$sernum = \$target->serial_number;\n\t\t\t\t\tprint \"Serial number for \$target is \$sernum\\n\";\n\t\t\t\t\t\$parentlink->{\$self}->{\$method} = \$sernum;\n\t\t\t\t\t#\$obj->reflect->addSlot([\$par,,\"description\",\$sernum]=>\$target);\n\t\t         }\n\t\t\t\tif (\$attr&&(\$method !~ /bootstrap/i))\n\t\t\t\t\t{\$ret .= '\$o->jaddSlot(\"'.\$method.\"\\\" => \".\$data.\");\\n\";}\n\t          }\n        else {print \"Not a slot: \$slot\\n\"}}\n              if (\$self eq \$self->bootObj)\n        {\n    \$ret .= '\$o->reflect->addSlot(bootObj=>\$o);\n    my \$bootObj = \$o;\n    ';\n        }\n        \$ret .=\"\\n\\n\\n\";\n        #print \"Returning \$ret\\n\";\n        return \$ret;}");
$o->jaddSlot("use_statements" => "sub{\nforeach my \$use (split /\\n/,\n\"\nuse Prima::PodView;\nuse Prima::Notebooks;\nuse HTTP::Lite;\nuse Tk;\nuse Prima qw(Application Buttons);\nuse Prima::Edit;         \nuse Prima::ImageViewer; \nuse Prima::Lists;\nuse Prima::InputLine;\nuse Prima::FrameSet;         \nuse blahblahblah;\n\n\")\n{\nprint \"Calling: \$use...\"; eval \$use;\nif (\$\@){print \"fail!\\n\",\$\@,\"\\n\";}\nelse    {print \"done.\\n\";}\n}}");
$o->jaddSlot("jaddSlot" => "sub { my \$self = shift;\n    my \$method = shift; my \$val = shift;\n    \nif (\$method =~ /^widget_/){\$val = undef;undef(\$val);print \"Intercepted widget\n\";}\nif (!defined(\$val)){\$val=Dumper(undef);};\n\tmy \$prefix = q'my \$s = \$_[0];'; my \$postfix = '';\n\tmy \$transformed = \$val;\n\t\$transformed =~ s!^sub{!sub{my \\\$s = \\\$_[0];!;\n#    print \"Inserting \$method=>\".\$transformed.\"\\n\";\n    print \"Inserting \$method\\n\";\n    \$!=\$\@=undef;\n    \$self->reflect->addSlot([\$method,,description=>\$val]=>eval(\$transformed));\n    print \$!, \$\@;\n    return \$self;}");
$o->jaddSlot("prototypes" => "sub{\n  my \@proto = grep { !(m/^BootObj\$/) } \@{\$s->oblist};\n  return \\\@proto;\n  }");
$o->jaddSlot("snapshot" => "sub{\nmy \$copy = \$_[0]->find(\"OS\")->system_copy;\n    print \"Saving snapshot\\n\";\n    my \$i=0;\n    my \$objects = \$_[0]->objects;\n\t\$_[0]->objects({});\n\t\$_[0]->oblist([]);\n    foreach my \$o (keys %{\$objects})\n      {\$i++;\n      my \$obj = \$objects->{\$o};\n      print \"Serial number for \$obj(\".\$obj->i_am_a.\") is \$i\\n\";\n      eval { \$obj->shutdown;};\n      \$obj->jaddSlot(\"serial_number\"=>\$i);}\n      \n      foreach my \$o (keys %{\$objects})\n      {\$i++;\n      my \$obj = \$objects->{\$o};\n      my \$par_nums = {};\n      foreach my \$par (\$obj->reflect->slotNames('PARENT'))\n        {\n\t\t\t\n          my \$target;\n          eval { \$target = \$obj->{\$par};};\n          if (\$target)\n          {\n\t\t  print \"Looking at object: \".\$obj->i_am_a.\".\\n\";\n          my \$sernum;\n\t\t\teval {\$sernum = \$target->serial_number};\n\t\t\tif (\$sernum){\n      print \"Serial number for \$target is \$sernum\\n\";\n      \$par_nums->{\$par} = \$sernum;\n      \$obj->reflect->addSlot([\$par,,\"description\",\$sernum]=>\$target);\n      eval {\$obj->\$par(undef)}}}}\n      \$parentlink->{\"\$o\"} = \$par_nums;\n      \n      \n    }\n   \n      \n    my \$snapfile;\n    open \$snapfile, \">\", \"snapshot.pl\" or die  \"Could not open snapshot\\n\";\n    print \$snapfile \"use Term::ReadLine;\\nuse lib 'modules';\\nuse Class::Prototyped;\\nuse strict;\\nuse warnings;\\nuse threads;\\nuse threads::shared;\\nuse Data::Dumper;\\n\\\$Data::Dumper::Useqq = 1;\\n\\\$Data::Dumper::Terse = 1;\\n\\\$Data::Dumper::Indent = 1;\\nour \\\$o;\\nmy \\\$parentlink = {};\\n\";\n    print \$snapfile \$_[0]->bootObj->serialise;\n    print \$snapfile \"\\n\\\$bootObj->register;\\n\";\n\tmy \@objects = keys %{\$objects};\n\tprint \"Saving \".scalar(\@objects).\"objects: \@objects\\n\";\n    foreach my \$o (\@objects)\n      {my \$obj = \$objects->{\$o};\n      next if \$obj eq \$_[0]->bootObj;\n      my \$ret = \$obj->serialise;\n      print \$\@,\$!,\"\\n\\n\";\n      print \$snapfile \$ret;\n      #print \$ret;\n      print \$\@,\$!,\"\\n\\n\";\n      }\n      \n      print \$snapfile \"sub object_link {my \\\$child = shift;  my \\\$linkname = shift;  my \\\$parent = shift;\n      \\\$child = \\\$bootObj->sersearch(\\\$child);\n      \\\$parent = \\\$bootObj->sersearch(\\\$parent);\n      print \\\"Linking child \\\$child to parent \\\$parent via link \\\$linkname\\n\\\";\n      \\\$child->reflect->addSlot(\\\$linkname => \\\$parent);\n    }\\n\\n\";\n      foreach my \$o (\@objects)\n        {my \$obj = \$objects->{\$o}; my \$par_nums = \$parentlink->{\$o};\n        foreach my \$parlink (keys %{\$par_nums})\n          {print \$snapfile \"object_link(\".\$obj->serial_number.\", '\$parlink', \".\$par_nums->{\$parlink}.\");\\n\";}}\n\t  print \$snapfile '\$bootObj->boot;';\n      print \"Finishing snapshot \".\$_[0]->age.\"\\n\";\n    close \$snapfile;                      \n    \n\tmy \$cmd = \$copy.\" snapshot.pl snapshot.pl.\".\$_[0]->age;\n\t`\$cmd`;\n\texit;}");
$o->jaddSlot("serialise_fields" => "sub\n    {\n      my \$self=shift;\t\n\t  my \$ret = \"#Fields:\\n\";\n\t\t\tforeach my \$method (\$self->reflect->slotNames('FIELD'))\n         {\n\t\t\tmy (\$val, \$slot) = \$self->reflect->getSlot(\$method,\"rotated\");\n\t\t\tif (\$slot){\n\t\t\t\tmy \$attr = \$slot->{attribs};\n\t\t\t\tmy \$data = Dumper(\$slot->{value});\n\t\t\t\tif(\$method =~ /objects/i) {\$data = Dumper({})};\n\t\t\t\tif(\$method =~ /oblist/i){\$data = Dumper([])};\n                                if(\$method =~ /^widget_/) { \$data = \"undef\"}\n                                my \$target = \$slot->{value};\n                                if (ref(\$target) =~ /PKG/ ) \n\t\t\t\t{\n\t\t\t\t\t\$data = \"undef\"\t;\n\t\t\t\t\tprint \"Processing stadard attribute link\\n\";\n\t\t\t\t\tprint \"Looking at object: \".\$self->i_am_a.\".\\n\";\n\t\t  \t\t\t#print Dumper(\$target);\n\t\t\t\t\tmy \$sernum = \$target->serial_number;\n\t\t\t\t\tprint \"Serial number for \$target is \$sernum\\n\";\n\t\t\t\t\t\$parentlink->{\$self}->{\$method} = \$sernum;\n\t\t\t\t\t#\$obj->reflect->addSlot([\$par,,\"description\",\$sernum]=>\$target);\n\t\t         }\n\n\t\t\t\tchomp \$data;\n\t\t\t\t\$data = quotemeta \$data;\n\t\t\t\t\$data = '\"'.\$data.'\"';\n\t\t\t\t\n\t\t\t\tif (\$attr&&(\$method !~ /bootstrap/i))\n\t\t\t\t\t\t{if(\$method !~ /bootObj/i)\n\t\t\t\t\t\t\t{\$ret .= '\$o->jaddSlot(\"'.\$method.\"\\\" => \".\$data.\");\\n\";}}\n\t\t\t}\n\t\t }\n\t\treturn \$ret;\n\n\t}           ");
$o->jaddSlot("boot" => "sub {\n\tprint \"Booting....\\n\";\n\tmy \$self=shift;                       \n\n\n\$self->use_statements;\n\n\tmy \$lobby = \$self->objsearch(\"Lobby\");\n\tmy \$bootobj = \$self->objsearch(\"BootObject\");\n\tforeach my \$o (\@{\$self->oblist})\n\t\t{\n \n\$o->startup;}\n\t\$self->age(\$self->age+1);\n       if (\$self->autoApplication)\n       {\$self->objsearch(\$self->autoApplication)->go;}\n       else{\n\t\$self->objsearch(\"Documentation\")->go;\n\tmy \$p=\$self->objsearch(\"PrimaMenu\");\n       \$p->go;}\n\tmy \$c=\$self->objsearch(\"Keyboard_input_object\");\n\tprint \"Starting keyboard loop...\\n\";\n\t\$c->get_input;}");
$o->reflect->addSlot(bootObj=>$o);
    my $bootObj = $o;
    



$bootObj->register;
#Object: PrimaBrowser
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("input_method_name" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.entry\"\
\}\,\ \'Tk\:\:Entry\'\ \)");
$o->jaddSlot("i_am_a" => "\"PrimaBrowser\"");
$o->jaddSlot("widget_code" => "undef");
$o->jaddSlot("widget_list_object" => "undef");
$o->jaddSlot("widget_list_methods" => "undef");
$o->jaddSlot("widget_input_method" => "undef");
$o->jaddSlot("widget_error_display" => "undef");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("widget_frameset" => "undef");
$o->jaddSlot("selected_object" => "undef");
$o->jaddSlot("selected_method" => "\"boot\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("tagline" => "\"I\ create\,\ delete\ and\ edit\ methods\ on\ an\ object\"");
$o->jaddSlot("isApplication" => "\"yes\"");
$o->jaddSlot("humanName" => "\"Object\ Editor\"");
$o->jaddSlot("documentation" => "\"\=head1\ NAME\ PrimaBrowser\ \-\ Edit\ Objects\ Graphically\\n\\n\=head1\ ABSTRACT\ \\nPrimaBrowser\ displays\ the\ source\ code\ of\ objects\ and\ is\ the\ place\ where\ you\ add\,\ delete\ and\ edit\ methods\\nin\ objects\.\\n\\n\=head1\ USE\\n\\nThe\ top\ left\ pane\ displays\ the\ prototypes\ in\ the\ system\,\ the\ pane\ to\ the\ right\ shows\ the\ methods\ for\ \\na\ selected\ object\.\ \ The\ delete\ and\ update\ buttons\ work\ on\ the\ selected\ method\,\ while\ the\ add\\nbutton\ will\ create\ a\ new\ method\ named\ in\ the\ text\ box\ above\.\\n\\nWarning\,\ switching\ to\ a\ new\ method\ will\ dump\ any\ changes\ you\ have\ made\ to\ the\ edit\ window\.\ \ Make\\nsure\ you\ update\ first\!\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\n\"");
$o->jaddSlot("serial_number" => "1");
#Methods: 
$o->jaddSlot("callback_update_method" => "sub{\$s->update}\n");
$o->jaddSlot("check_eval" => "sub{\n\t\n\tmy \$code = \t\$s->widget_code->text;\n\t\$\@ = undef;\n\teval \$code;\n\tif (\$\@)\n\t\t{print \$\@, \"\\n\";\$s->widget_error_display->text(\$\@);\n\t\t#\$s->window->Dialog(-text=>\$\@)->Show;\n\t\treturn undef;}\n\t\$s->widget_error_display->text(\"Your code compiled cleanly\");\n\treturn 1;\n\t}\n\n\n\n");
$o->jaddSlot("go" => "sub{\n\t\$s->widget_window(\$s->find(\"PrimaBrowser\"));\n\t\$s->selected_method(undef);\n\t\$s->gstartup;\n\t\$s->display_objs;\n#\t\$s->display;\n\t}\n\n\n\n\n\n\n");
$o->jaddSlot("callback_delete_method" => "sub{ \$s->selected_object->reflect->deleteSlots(\$s->selected_method)}\n\n\n\n\n");
$o->jaddSlot("update" => "sub{\n#eval{\nprint \"Updating \".\$s->selected_object->i_am_a.\"'s method \".\$s->selected_method.\" with \". \$s->widget_code->text .\"\\n\";\nif(\$s->check_eval)\n{\$s->selected_object->jaddSlot(\$s->selected_method, \$s->widget_code->text);}\n\n}\n");
$o->jaddSlot("display" => "sub{                                                                          \n         \n\t\$s->clear_methods;\n\tforeach my \$method (sort(\$s->selected_object->reflect->slotNames))\n        {\n      next if (\$method=~ /\\*\$/ );\n        my (\$val, \$slot) = \$s->selected_object->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->widget_list_methods->add_items(\$method );\n        \n          }}\n\n\n\t\t  }");
$o->jaddSlot("callback_add_method" => "sub{\$s->clear_methods;\$s->selected_object->jaddSlot(\$s->widget_input_method->text, q!\"add your data or subroutine here.\\n  If you do add a sub, make sure the first 4 letters are sub{ to allow macros to detect it properly.\"!);\$s->display;}");
$o->jaddSlot("clear_methods" => "sub{\n\t\n\t\$s->widget_list_methods->delete_items(0..\$s->widget_list_methods->count);\n\t#\$s->methedit->Contents(\"\");\n\t}");
$o->jaddSlot("display_objs" => "sub{                                             \n                  my \@names = map {\$_->i_am_a} \@{\$s->oblist()}; \n\t\t  foreach my \$o (sort(\@names))\n\t\t{\$s->widget_list_object->add_items(\$o)}}");
$o->jaddSlot("edit_object" => "sub{\n  \$s->selected_object(\$_[1]);\n  \$s->display;\n  }");
$o->jaddSlot("shutdown" => "sub{\$s->selected_object(undef);}");
$o->jaddSlot("callback_object_selected" => "sub{                              \n\n\tmy \$ob_name = \$_[1];\n\tprint \"Selected \$ob_name\\n\";\n\t\$s->selected_object(\$s->find(\$ob_name));\n        \$s->selected_method(undef);   \n        \$s->widget_code->text( \"\" );\n\t\$s->display;              \n\$s->widget_window->text(\$s->selected_object->i_am_a);\n}");
$o->jaddSlot("callback_method_selected" => "sub{\n\tmy \$method = \$_[1];\n\t  \$s->selected_method(\$method);\n        my (\$val, \$slot) = \$s->selected_object->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$slot->{value};\n        \$Data::Dumper::Useqq = 0;\n\tif (\$s->selected_object->reflect->slotType(\$method) eq 'METHOD')\n\t\t{\$data = \$attr->{description};}            \n      else {\$data = Dumper(\$data)}\n      \$Data::Dumper::Useqq = 1;\n        \$s->widget_code->text( \$data );\n        \$s->widget_error_display->text(\"\");\n          }\n\$s->widget_window->text(\$s->selected_object->i_am_a.\" -> \".\$method);\n\t\t  }");
$o->jaddSlot("gstartup" => "sub{\n\n use Prima qw(Application Buttons);\nuse Prima::Edit;\nuse Prima::Lists;\nuse Prima::InputLine;\nuse Prima::FrameSet;\n\n              \$s->widget_window(\n new Prima::Window(\n                       text     => \"Object Editor\",\n                       size     => [ 500, 400],\n\t\t\tonClose => sub{},\n               )\n\t);\n\n\n\n\n        \$s->widget_frameset(\nPrima::FrameSet->create(\n                frameSizes => [qw(211 20% 123 10% * 45% *)],\n                opaqueResize => 0,\n                frameProfiles => [ 0,0, { minFrameWidth => 123, maxFrameWidth => 123 }],\n                owner => \$s->widget_window,\n                pack => {anchor=>'n', side=>'top',fill=>'both', expand=>1},\n)        );\n\nmy \$w = \$s->widget_frameset;\n  \$s->widget_list_object(\n\t Prima::ListBox-> create(\n                items       => [],\n                onSelectItem     => sub {\n                        \$s->callback_object_selected(\$_[0]-> get_items( \$_[0]-> focusedItem));\n                },\n                owner => \$w,\n                pack => {anchor=>'n',side=>\"left\", fill=>'both',expand=>1},\n        )\n);\n\n  \$s->widget_list_methods(\n Prima::ListBox-> create(\n                items       => [],\n                onSelectItem     => sub {\n\$s->callback_method_selected(\$_[0]-> get_items( \$_[0]-> focusedItem));\n                },\n                owner => \$w,\n                pack => {anchor=>'n',side=>'left', fill=>'both',expand=>1},\n)\n);\n\n\n\n\n\n\n\n\n\$s->widget_input_method(\nPrima::InputLine->create (\n                owner=>\$w,\n                pack => {anchor=>'n', side=>'top'},    \n                text => 'New Method Name',\n)                );\n\n\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'Add Method',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_add_method},\n        );\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'Delete Method',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_delete_method},\n        );\n\n\n       Prima::Button-> new(\n                owner => \$w,\n                text  => 'Update Method',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_update_method},\n        );\n\n        \$s->widget_code(\n Prima::Edit -> create(\n                text         => 'Code Window',\n                syntaxHilite => 1,\n                owner => \$s->widget_window,\n                pack => {expand =>2, fill =>'both'},\n)        );\n\n\n\n        \$s->widget_error_display (\n Prima::Edit -> create(\n                text         => 'Hello \$world',\n                height=>100,\n                syntaxHilite => 1,\n                owner => \$s->widget_window,\n                pack => {expand =>0, fill =>'both'},\n)        );\n\n\n\n\n\n\t}");



#Object: UniversalTraits
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"UniversalTraits\"");
$o->jaddSlot("tagline" => "\"I\ contain\ methods\ that\ every\ object\ should\ be\ able\ to\ call\"");
$o->jaddSlot("serial_number" => "2");
#Methods: 
$o->jaddSlot("find" => "sub{\n\tmy \$search = \$_[1];\n\tmy \$obj;\n\tif(\$search>0){\$obj = \$obj->sersearch(\$search);}\n\telse {\$obj = \$_[0]->objsearch(\$search);}\n\treturn \$obj;\n\t}\n");



#Object: GuiInspector
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"GuiInspector\"");
$o->jaddSlot("tagline" => "\"I\ display\ an\ object\ in\ a\ window\"");
$o->jaddSlot("target" => "\"\"");
$o->jaddSlot("wh" => "\"\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "3");
#Methods: 
$o->jaddSlot("go" => "sub{\n\t\$s->target(\$s->find(\"GuiInspector\"));\n\t\$s->gstartup;\n\t\$s->display;\n\tMainLoop();}");
$o->jaddSlot("gstartup" => "sub{my \$top = MainWindow->new; \n#\tmy \$text = \$top -> Scrolled('Text');\$text->pack(-anchor=>\"n\", -side=>\"top\" );\n#\t\$s->in_handle(\$text);\n#\tmy \$text2 = \$top -> Scrolled('Text');\$text2->pack( -anchor=>\"s\", -side=>\"bottom\");\n#\t\$s->res_handle(\$text2);\n\tmy \$button = \$top->Button(-text=>\"Run\", -command=>sub {\$s->run;}); \$button->pack();\n\tmy \$fr = \$top->Scrolled(\"Frame\");\$fr->pack(-anchor=>'n', -side=>'top', -fill=>'both', -expand=>1);\n\t\$s->wh(\$fr);\n\t}");
$o->jaddSlot("display" => "sub{\n\tforeach my \$method (\$s->target->reflect->slotNames)\n        {\n      \n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->sm( \$method , \$data);\n        \n          }}\n\t\t  }");
$o->jaddSlot("sm" => "sub{\n\tmy \$method = \$_[1];\n\tmy \$data = \$_[2];\n\t#print \$method, \$data;\n\tmy \$fr = \$s->wh->Frame();\$fr->pack(-anchor=>'n', -side=>'top');\n\tmy \$text = \$fr -> Label(-text=>\$method);\$text->pack(-anchor=>\"w\", -side=>\"left\" );\n\t#\$s->in_handle(\$text);\n\tmy \$text2 = \$fr -> Scrolled('Text', -height=>10, -width=>80);\$text2->pack( -anchor=>\"e\", -side=>\"right\");\$text2->Contents(\$data);\n\t#\$s->res_handle(\$text2);\n\tmy \$button = \$fr->Button(-text=>\"Update\", -command=>sub {\$s->jaddSlot(\$method => \$text2->Contents);}); \$button->pack();\n\t}");



#Object: HypoBrowser
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"HypoBrowser\"");
$o->jaddSlot("wikiData" => "\{\
\ \ \"notFound\"\ \=\>\ \"\=head1\ Page\ Not\ Found\\n\\nWe\ couldn\'t\ find\ your\ page\.\ \ You\ could\ try\ going\ to\ the\ L\<Home\>\ page\.\\n\\n\"\,\
\ \ \"Home\"\ \=\>\ \"\=head1\ Home\\n\"\,\
\ \ \"LinkTest\"\ \=\>\ \"\=head1\ NAME\\n\\nWoohoo\!\\n\\nL\<asasdf\>\"\
\}");
$o->jaddSlot("widget_edit" => "undef");
$o->jaddSlot("widget_podview" => "undef");
$o->jaddSlot("widget_notebook" => "undef");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("tagline" => "\"I\ display\ information\ that\ is\ easy\ to\ edit\ and\ navigate\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Web\ Browser\"");
$o->jaddSlot("widget_input_method" => "undef");
$o->jaddSlot("documentation" => "\"\=head1\ NAME\ HypoBrowser\ \-\ A\ very\ simple\ webbrowser\ built\ using\ HTTP\:\:\ and\ POD\\n\\n\=head1\ ABSTRACT\\nHypoBrowser\ uses\ some\ basic\ Perl\ modules\ to\ load\ webpages\ and\ display\ them\.\\n\\n\=head1\ EXAMPLE\\n\ \ \\n\=head1\ API\\n\\n\=over\\n\\n\=item\ current_page\\nA\ string\ value\ describing\ the\ current\ page\ being\ viewed\.\\n\\n\ \ print\ \\\$s\-\>current_page\;\\n\ \ \\n\ \ \\\"Home\\\"\\n\ \ \\n\=item\ load_page\(\\\$page_name\)\\nimmediately\ loads\ the\ named\ page\,\ if\ it\ exists\.\ \ Make\ sure\ you\ have\ a\ window\ open\ first\.\\n\\n\ \\\$s\-\>load_page\(\\\"Home\\\"\)\;\\n\ \\n\=item\ initialise\(\)\\nreset\ the\ wiki\ data\.\\n\\n\ \ \\\$s\-\>initialise\(\)\;\\n\\n\"");
$o->jaddSlot("current_page" => "\"http\:\/\/www\.perl\.com\/\"");
$o->jaddSlot("serial_number" => "4");
#Methods: 
$o->jaddSlot("go" => "sub{       \$s->wikiStart;                              }");
$o->jaddSlot("callback_save" => "sub{\n\$s->wikiData->{\$s->current_page} = \$s->widget_edit->text();    \n\$s->load_page(\$s->current_page);        \n\$s->widget_notebook->set(pageIndex =>0);\n}");
$o->jaddSlot("callback_edit" => "sub{\n\$s->widget_notebook->set(pageIndex =>1);\n}\n");
$o->jaddSlot("make_index" => "sub{\n  my \$h = \$s->wikiData;\n  my \$d = \"=head1 Table of Contents\\n\";\n  foreach my \$k ( keys %{\$h} )\n    {                                 \n       my \@lines =      split (/\\n/, \$h->{\$k})       ;\n       my \$line = shift \@lines;\n       \$line =~ s/=head.\\s*//;\n       \$d .= \"L<\".\$k.\"> \".\$line; \n       \$d .= \"\\n\\n\";\n       }\n     \$d .= \"\\n=back\\n\";\n   return \$d;\n   }");
$o->jaddSlot("callback_delete" => "sub{\ndelete \$s->wikiData->{\$s->current_page};\n\$s->current_page(\"Home\");    \n\$s->load_page(\$s->current_page);        \n}\n");
$o->jaddSlot("initialise" => "sub{\nmy %h=();\n\$h{Home} = \"Home page\";\n\$h{ notFound} = '=head1 Create a new page?\n\nYou have followed a link to a page that doesn\\'t exist yet.  Click edit to create this new page.\nTry it, it\\'s easy and fun!  Well, easy and amusing, maybe.  Ok, not amusing, but not terrible either.\nLook, I like writing documentation.  Don\\'t judge me.';\n;\n\$s->wikiData(\\%h);\n}");
$o->jaddSlot("wikiStart" => "sub{\n  \neval'\npackage Prima::PodView;\n\nsub load_file\n{                                                       \n\n        my ( \$self, \$page) = \@_;\n        \$self->{myWikiCallback}( \$page);\n                                            \n                                               \n}\n';     \n   \n\n\nmy \$window = Prima::Window-> create(size     => [ 600, 450]);\n\n\$s->widget_input_method(\nPrima::InputLine->create (\n                owner=>\$window,\n                pack => {anchor=>'n', side=>'top'},\n)                );\n\"Prima::Button\" ->create(\n                owner=>\$window,\n                text  => 'Load',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_load},\n);\n\n\nmy \$nb = \$window->insert( TabbedScrollNotebook =>                               \n        pack => { fill => 'both', expand => 1, padx=>10, pady=>10 },             \n        pageCount =>2,                       \n        \n       \n        tabs => [ 'View', 'Edit' ],\n);                                    \n\nmy \$podview = \$nb-> insert_to_page( 0 =>   \n       \n        \"Prima::PodView\",\n        pack => { fill => 'both', expand => 1 }\n        ,);        \n\$podview->{myWikiCallback} = sub { my \$p = shift;  \$s->load_page(\$p) };        \n\$nb-> insert_to_page( 0 =>        \n        [\"Prima::Button\",\n                owner => \$window,\n                text  => 'Edit',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_edit},\n       ]\n\n        );                                               \n\nmy \$podedit = \$nb-> insert_to_page( 1, \"Prima::Edit\"    ,\n        pack => { fill => 'both', expand => 1 }   \n);\n        \n\$nb-> insert_to_page( 1, \"Prima::Button\"    ,\n                text  => 'Save',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_save},\n);\n        \$nb-> insert_to_page( 1 =>        \n        [\"Prima::Button\",\n                owner => \$window,\n                text  => 'Delete Page',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_delete},\n       ]\n\n        );\n\n#\$nb->Notebook->backColor( cl::Green);\n#\$nb->use_current_size;                                 \n                                  \n        \n\$s->widget_edit(\$podedit);   \n\$s->widget_edit(\$podedit);   \n\$s->widget_podview(\$podview);                      \n\$s->widget_notebook(\$nb);\n\$s->widget_window(\$window);\n#\$s->current_page(\"Home\");\n\$s->load_page(\$s->current_page);\n\n    }");
$o->jaddSlot("callback_load" => "sub{\n  \$s->load_page(\$s->widget_input_method->text);}");
$o->jaddSlot("load_page" => "sub{ \nmy \$podview = \$s->widget_podview;  \nmy \$page = \$_[1];                 \nif (\$page =~/^http:!!/i) {\$page =~ s~!~/~g;} \n\$s->current_page(\$page);\n\$s->widget_input_method->text(\$s->current_page);\n       print \"Loading page \$page\\n\";   \nmy \$raw = \$s->find(\"HTTPLite\")->quick(\$s->current_page);   \n use Pod::HTML2Pod;\n  my \$pod =  Pod::HTML2Pod::convert(\n    content=>\$raw,  # input file\n    'a_href' => 1,  # try converting links\n  );\n\n use HTML::TokeParser::Simple;\n my \$p = HTML::TokeParser::Simple->new( \\\$raw );\n  my \$data = \"\"; \n while ( my \$token = \$p->get_token ) {\n     # This prints all text in an HTML doc (i.e., it strips the HTML)\n     next unless \$token->is_text;      \n     my \$text = \$token->as_is;\n     next unless \$text =~ / /;\n     \$data .= \$token->as_is.\"\\n\\n\";\n }\n\$data = \"=head1 Your page\\n\" . \$data;\n\$data=\$pod;\nif ( \$page eq \"Table of Contents\")\n  {\n    \$data = \$s->make_index;}\n\$data ||= \$s->wikiData->{notFound};\n        \$podview->open_read;\n        \$podview-> read(\$data.\"\\n\\nGo L<Home> or to the L<Table of Contents>\");\n        \$podview-> close_read;    \n        \$s->widget_edit->text(\$data);   \n        \$s->widget_window->text(\$page);\n    }");



#Object: GuiMenu
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"GuiMenu\"");
$o->jaddSlot("tagline" => "\"I\ display\ a\ simple\ menu\"");
$o->jaddSlot("target" => "\"\"");
$o->jaddSlot("selected_method" => "\"\"");
$o->jaddSlot("objectlist" => "\"\"");
$o->jaddSlot("methlist" => "\"\"");
$o->jaddSlot("methedit" => "\"\"");
$o->jaddSlot("window" => "undef");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "5");
#Methods: 
$o->jaddSlot("ObjectBrowser" => "sub{\$s->find(\"GuiBrowser\")->go;}");
$o->jaddSlot("PerlDocs" => "sub{\$s->find(\"GuiPerldoc\")->gui;}");
$o->jaddSlot("Snapshot" => "sub{\$s->snapshot;}");
$o->jaddSlot("Eval" => "sub{\$s->find('GuiEval')->gstartup;}\n\n");
$o->jaddSlot("gstartup" => "sub{my \$top = MainWindow->new; \n\$s->window(\$top);\nmy \@buttons = ();\nforeach my \$butt ( \@{[ \"ObjectBrowser\", \"Snapshot\", \"PerlDocs\", \"Eval\", \"InheritenceEditor\" ]} )\n\t{\n\t\tprint \"Adding button \$butt\\n\";\n\t\tmy \$button = \$top->Button(-text=>\$butt, -command=>sub {\$s->\$butt;}); \$button->pack();\t\n\t\tpush \@buttons, \$button;\n}\nMainLoop();}\n\n");
$o->jaddSlot("InheritenceEditor" => "sub{\$s->find('GuiInheritenceEditor')->go;}\n\n");
$o->jaddSlot("go" => "sub{\$s->gstartup;}\n");



#Object: OldGuiBrowser
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("tagline" => "\"I\ display\ an\ object\ in\ a\ window\"");
$o->jaddSlot("target" => "undef");
$o->jaddSlot("selected_method" => "\"duplicate\"");
$o->jaddSlot("objectlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methedit" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame1\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("errorbox" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame2\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("window" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.\"\
\}\,\ \'MainWindow\'\ \)");
$o->jaddSlot("i_am_a" => "\"OldGuiBrowser\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "6");
#Methods: 
$o->jaddSlot("go" => "sub{\n\t\$s->target(\$s->find(\"GuiBrowser\"));\n\t\$s->gstartup;\n\t\$s->display_objs;\n\t\$s->display;\n\t}");
$o->jaddSlot("update" => "sub{\n#eval{\nprint \"Updating \".\$s->target->i_am_a.\"'s method \".\$s->selected_method.\" with \". \$s->methedit->Contents .\"\\n\";\nif(\$s->check_eval)\n{\$s->target->jaddSlot(\$s->selected_method, \$s->methedit->Contents);}\n\n}");
$o->jaddSlot("check_eval" => "sub{\n\t\n\tmy \$code = \t\$s->methedit->Contents;\n\t\$\@ = undef;\n\teval \$code;\n\tif (\$\@)\n\t\t{print \$\@, \"\\n\";\$s->errorbox->Contents(\$\@);return undef;}\n\t\t\$s->errorbox->Contents(\"Your code compiled cleanly\");\n\treturn 1;\n\t}");
$o->jaddSlot("clear_methods" => "sub{\n\t\$s->methlist->delete(0,\"end\");\n\t\$s->methedit->Contents(\"\");\n\t}");
$o->jaddSlot("sm" => "sub{\n\tmy \$method = \$_[1];\n\tmy \$data = \$_[2];\n\t#print \$method, \$data;\n\tmy \$fr = \$s->wh->Frame();\$fr->pack(-anchor=>'n', -side=>'top');\n\tmy \$text = \$fr -> Label(-text=>\$method);\$text->pack(-anchor=>\"w\", -side=>\"left\" );\n\t#\$s->in_handle(\$text);\n\tmy \$text2 = \$fr -> Scrolled('Text', -height=>10, -width=>80);\$text2->pack( -anchor=>\"e\", -side=>\"right\");\$text2->Contents(\$data);\n\t#\$s->res_handle(\$text2);\n\tmy \$button = \$fr->Button(-text=>\"Update\", -command=>sub {\$s->jaddSlot(\$method => \$text2->Contents);}); \$button->pack();\n\t}");
$o->jaddSlot("display_objs" => "sub{\n\t\t  foreach my \$o (sort(\@{\$s->oblist()}))\n\t\t{\$s->objectlist->insert(0,\$o->i_am_a)}}\n");
$o->jaddSlot("gstartup" => "sub{\nmy \$top = MainWindow->new; \n\t\$s->window(\$top);\n;\n\t\n\tmy \$fr = \$top->Frame;\$fr->pack(-anchor=>'n', -side=>'top', -fill=>'both', -expand=>1);\n\tmy \$objectlist = \$fr->Scrolled(\"Listbox\");\$objectlist->pack(-anchor=>'w', -side=>'left', -fill=>'both', -expand=>1);\n\t\$objectlist -> bind ('<<ListboxSelect>>', sub{\$s->clear_methods;\$s->target(\$s->find(\$objectlist->get(\$objectlist->curselection)));\$s->display;});\n\n\tmy \$methfr = \$fr->Frame;\$methfr->pack();\n\tmy \$methlist = \$methfr->Scrolled(\"Listbox\");\$methlist->pack(-anchor=>'w', -side=>'left', -fill=>'both', -expand=>1);\n\tmy \$newmeth = \$methfr->Entry; \$newmeth->pack();\n\tmy \$newmethbut = \$methfr->Button(-text=>\"Add method\", -command=>sub{\$s->clear_methods;\$s->target->jaddSlot(\$newmeth->get, q!\"add your data or subroutine here.\\n  If you do add a sub, make sure the first 4 letters are sub{ to allow macros to detect it properly.\"!);\$s->display;});\$newmethbut->pack();\n\n\tmy \$delmethbut = \$methfr->Button(-text=>\"Delete method\", -command=>sub{\$s->delete_method_callback; \$s->display;});\$delmethbut->pack();\n\n\n\t\$methlist -> bind ('<<ListboxSelect>>', sub{\$s->display_slot(\$methlist->get(\$methlist->curselection))});\n\tmy \$meth = \$top->Scrolled(\"Text\");\$meth->pack(-anchor=>'n', -side=>'top', -fill=>'both');\n\tmy \$errbox = \$top->Scrolled(\"Text\", -height=>3);\$errbox->pack(-anchor=>'n', -side=>'top', -fill=>'both', -expand=>1);\n\tmy \$button = \$methfr->Button(-text=>\"Update\", -command=>sub {print \"Running update\"; \$s->update;}); \$button->pack();\n\t\$s->objectlist(\$objectlist);\n\t\$s->methlist(\$methlist);\n\t\$s->methedit(\$meth);\n\t\$s->errorbox(\$errbox);\n\tprint \"Graphics started\\n\";\n\t}\n\n\n\n\n");
$o->jaddSlot("display" => "sub{\n\tforeach my \$method (sort(\$s->target->reflect->slotNames))\n        {\n      next if (\$method=~ /\\*\$/ );\n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->methlist->insert(0, \$method );\n        \n          }}\n\$s->window->configure(-title=>\"Editing object: \".\$s->target->i_am_a);\n\t\t  }\n\n\n");
$o->jaddSlot("display_slot" => "sub{\n\tmy \$method = \$_[1];\n\t  \$s->selected_method(\$method);\n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->methedit->Contents( \$data );\n        \$s->errorbox->Contents(\"\");\n          }\n\$s->window->configure(-title=>\"Editing object: \".\$s->target->i_am_a.\" -> \".\$method);\n\t\t  }\n\n");
$o->jaddSlot("delete_method_callback" => "sub{ \$s->target->reflect->deleteSlots(\$s->methlist->get(\$s->methlist->curselection))}\n\n");



#Object: Command_executor
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Command_executor\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "7");
#Methods: 
$o->jaddSlot("execute" => "sub{\n\tmy \$c = \$_[1];\n  \$! = \$\@ = undef;\n\tmy \$res = eval \$c;\n\tprint \$res, \"\\n\";\n  warn \$\@ if \$\@;\n  return \$res;\n}");
$o->jaddSlot("tagline" => "sub{return \"I execute perl code\"}");



#Object: GuiEval
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"GuiEval\"");
$o->jaddSlot("subject" => "\"perl\"");
$o->jaddSlot("code" => "\"ref\(\\\$s\-\>find\(\\\"GuiBrowser\\\"\)\-\>window\)\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\"");
$o->jaddSlot("result" => "\"MainWindow\"");
$o->jaddSlot("in_handle" => "bless\(\ \{\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("res_handle" => "bless\(\ \{\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame1\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("error_result" => "\"\"");
$o->jaddSlot("tagline" => "\"I\ provide\ a\ handy\ window\ to\ try\ out\ perl\ code\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "8");
#Methods: 
$o->jaddSlot("load" => "sub{my \$cmd = \"perldoc \".\$s->subject; my \$content = `\$cmd`;\$s->content(\$content); print \$content;}");
$o->jaddSlot("run" => "sub{\n\t\t\$s->code(\$s->in_handle->Contents());\n\t;\n\t\tmy \$res =  eval(\$s->code());\n\t\t\$s->result(\$res); \n\t\n\t\t\$s->res_handle->Contents(\$\@?\$\@:\$res);}\n\n\n\n");
$o->jaddSlot("gstartup" => "sub{my \$top = MainWindow->new; \nmy \$button = \$top->Button(-text=>\"Run\", -command=>sub {\$s->run;}); \$button->pack();\t\n\nmy \$text = \$top -> Scrolled('Text');\$text->pack(-anchor=>\"n\", -side=>\"top\" );\n\t\$s->in_handle(\$text);\n\t\$text->Contents(\$s->code);\n\n\nmy \$text2 = \$top -> Scrolled('Text');\$text2->pack( -anchor=>\"s\", -side=>\"bottom\");\n\t\$s->res_handle(\$text2);\n\t\$text2->Contents(\$s->result);\n\t\n\t\n\tMainLoop();}\n\n");



#Object: PrimaMenu
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"PrimaMenu\"");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("tagline" => "\"The\ start\ menu\,\ using\ the\ prima\ gui\ system\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "9");
#Methods: 
$o->jaddSlot("go" => "sub{ \$s->gstartup}\n\n");
$o->jaddSlot("Snapshot" => "sub{\$s->snapshot;}\n");
$o->jaddSlot("PrimaBrowser" => "sub{ \$s->find(\"PrimaBrowser\")->go}\n");
$o->jaddSlot("PrimaEval" => "sub{ \$s->find(\"PrimaEval\")->go}\n\n");
$o->jaddSlot("shutdown" => "sub{\n\$s->window(undef);\n}\n");
$o->jaddSlot("InheritenceEditor" => "sub{\$s->find(\"PrimaInheritenceEditor\")->go;}");
$o->jaddSlot("ObjectManager" => "sub{ \$s->find(\"PrimaObjectManager\")->go}");
$o->jaddSlot("gstartup" => "sub{use Prima qw(Application Buttons);\n\n        my \$win = new Prima::MainWindow(\n                text     => 'Menu',\n                size     => [ 200, 600],\n        );\n\t\$s->widget_window(\$win);\neval {                                                                      \nprint \"Searching oblist\\n\";\nmy \@apps;                                       \n  foreach my \$o ( \@{\$s->oblist})\n  {\n    print \"Object: \".\$o->i_am_a.\"\\n\";     }\n  eval { \@apps = grep { eval { print \"Examing \".\$_->i_am_a.\"\\n\";\$_->isApplication};  } \@{\$s->oblist};};\n  #print \$\@;\nprint \"Searched oblist, found: \", \@apps, \"\\n\";   \nmy \@sorted = sort { \$a->humanName cmp \$b->humanName } \@apps;\nforeach my \$app ( \@sorted) \n{\n  print \"Found app: \". \$app->i_am_a.\"\\n\";\n\t\$win -> insert( Button =>\n                centered => 1,\n                text     => \$app->humanName,\n                onClick  => sub {\$app->go;},                \n \t\tpack     => { expand => 1 },\n        );\n}\n};\n        while (1){run Prima;}\n}");



#Object: HTTPLite
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"HTTPLite\"");
$o->jaddSlot("requires" => "\[\
\ \ \"HTTP\:\:Lite\"\,\
\ \ \"HTML\:\:FormatText\:\:WithLinks\"\
\]");
$o->jaddSlot("tagline" => "\"I\ load\ webpages\"");
$o->jaddSlot("code" => "200");
$o->jaddSlot("content" => "undef");
$o->jaddSlot("text" => "\"\"");
$o->jaddSlot("wrapped" => "undef");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("url" => "\"http\:\/\/www\.perl\.com\/\"");
$o->jaddSlot("serial_number" => "10");
#Methods: 
$o->jaddSlot("asText" => "sub{require HTML::FormatText::WithLinks;my \$f = HTML::FormatText::WithLinks->new();\n\t\$_[0]->text(\$f->parse(\$_[0]->content));\n\treturn \$_[0]->text;}");
$o->jaddSlot("go" => "sub{\$_[0]->quick(\$_[1]);print \$_[0]->asText;}");
$o->jaddSlot("startup" => "sub{\$_[0]->wrapped(new HTTP::Lite);}");
$o->jaddSlot("quick" => "sub{ my \$url = \$_[1];\nprint \"Loading \$url\\n\";\n \$s->url(\$url); \$s->retrieve; return \$s->content;}");
$o->jaddSlot("retrieve" => "sub{             \nmy \$hl = new HTTP::Lite;\n\$s->wrapped(\$hl);\nmy \$code = \$_[0]->wrapped->request(\$_[0]->url);\n\$_[0]->code(\$code);\n\$_[0]->content(\$_[0]->wrapped->body);}");
$o->jaddSlot("shutdown" => "sub{\n\$s->content(undef);\n\$s->wrapped(undef);\n}");



#Object: PrimaEval
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"PrimaEval\"");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("widget_input" => "undef");
$o->jaddSlot("widget_output" => "undef");
$o->jaddSlot("code" => "\"\#return\ \\\$s\-\>find\(\\\"HTTPLite\\\"\)\-\>quick\(\\\"http\:\/\/reddit\.com\/\\\"\)\;\\nmy\ \\\$ret\ \=\ 1\+3\+5\+7\;\\n\\\$ret\ \.\=\\\"\\\\n\\\"\;\\nmy\ \\\$x\ \=\ \ \\\$s\-\>find\(\\\"HypoBrowser\\\"\)\;\\n\\\$ret\ \.\=\ \\\$x\-\>i_am_a\;\ \ \ \ \ \\nreturn\ \\\$ret\;\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \"");
$o->jaddSlot("output" => "\"16\\nHypoBrowser\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("tagline" => "\"I\ evaluate\ perl\ code\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Code\ Evaluator\"");
$o->jaddSlot("serial_number" => "11");
#Methods: 
$o->jaddSlot("go" => "sub{\$s->gstartup}\n");
$o->jaddSlot("gstartup" => "sub{use Prima qw(Application Buttons);\n\n        my \$w = new Prima::Window(\n                text     => 'Eval',\n                size     => [ 200, 200],\n        );\n\t\$s->widget_window(\$w);\n use Prima::Edit;\n\n        \$s->widget_input(Prima::Edit -> create(\n                text         => \$s->code,\n                syntaxHilite => 1,\n                owner => \$w,\n                pack => {expand =>1, fill =>'both'},\n                \n        ));\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'Run',\n                pack  => {},\n\t\tonClick => sub {\$s->callback_execute},\n        );\n        \$s->widget_output( Prima::Edit -> create(\n                text         => \$s->output,\n                syntaxHilite => 1,\n                owner => \$w,\n                pack => {expand =>1, fill =>'both'},\n        ));\n\n}");
$o->jaddSlot("callback_execute" => "sub{\n \$s->code( \$s->widget_input->text);\n my \$res = eval \$s->code;\n if (\$\@) {\$res = \$\@};\n \$s->output(\$res);\n\$s->widget_output->text(\$s->output);\n}");



#Object: Wiki
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Wiki\"");
$o->jaddSlot("wikiData" => "\{\
\ \ \"notFound\"\ \=\>\ \"\=head1\ Page\ Not\ Found\\n\\nWe\ couldn\'t\ find\ your\ page\.\ \ You\ could\ try\ going\ to\ the\ L\<Home\>\ page\.\\n\\n\"\,\
\ \ \"Home\"\ \=\>\ \"\=head1\ Home\\n\"\,\
\ \ \"LinkTest\"\ \=\>\ \"\=head1\ NAME\\n\\nWoohoo\!\\n\\nL\<asasdf\>\"\
\}");
$o->jaddSlot("widget_edit" => "undef");
$o->jaddSlot("widget_podview" => "undef");
$o->jaddSlot("widget_notebook" => "undef");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("current_page" => "\"Table\ of\ Contents\"");
$o->jaddSlot("tagline" => "\"I\ display\ information\ that\ is\ easy\ to\ edit\ and\ navigate\"");
$o->jaddSlot("documentation" => "\"\=head1\ NAME\ Wiki\ \-\ Trait\ class\ for\ wikis\\n\\n\=head1\ ABSTRACT\\nWiki\ is\ the\ trait\ class\ for\ all\ wikis\ in\ the\ system\.\ \ This\ means\ you\ do\ not\ use\ it\ directly\,\ but\ keep\ it\ as\ a\ parent\\nobject\.\ \ Instead\,\ copy\ a\ working\ wiki\ like\ \\\"Documentation\\\"\,\ reinitialise\ it\ and\ get\ cracking\.\\n\\n\=head1\ EXAMPLE\\n\\n\ \ my\ \\\$new_wiki\ \=\ \\\$s\-\>find\(\\\"Documentation\\\"\)\-\>clone\;\\n\ \ \\\$new_wiki\-\>initialise\;\\n\ \ \\\$new_wiki\-\>go\;\\n\ \ \\n\=head1\ API\\n\\n\=over\\n\\n\=item\ current_page\\nA\ string\ value\ describing\ the\ current\ page\ being\ viewed\.\\n\\n\ \ print\ \\\$s\-\>current_page\;\\n\ \ \\n\ \ \\\"Home\\\"\\n\ \ \\n\=item\ load_page\(\\\$page_name\)\\nimmediately\ loads\ the\ named\ page\,\ if\ it\ exists\.\ \ Make\ sure\ you\ have\ a\ window\ open\ first\.\\n\\n\ \\\$s\-\>load_page\(\\\"Home\\\"\)\;\\n\ \\n\=item\ initialise\(\)\\nreset\ the\ wiki\ data\.\\n\\n\ \ \\\$s\-\>initialise\(\)\;\\n\\n\"");
$o->jaddSlot("serial_number" => "12");
#Methods: 
$o->jaddSlot("go" => "sub{       \$s->wikiStart;                              }");
$o->jaddSlot("callback_save" => "sub{\n\$s->wikiData->{\$s->current_page} = \$s->widget_edit->text();    \n\$s->load_page(\$s->current_page);        \n\$s->widget_notebook->set(pageIndex =>0);\n}");
$o->jaddSlot("callback_edit" => "sub{\n\$s->widget_notebook->set(pageIndex =>1);\n}\n");
$o->jaddSlot("make_index" => "sub{\n  my \$h = \$s->wikiData;\n  my \$d = \"=head1 Table of Contents\\n\";\n  foreach my \$k ( keys %{\$h} )\n    {                                 \n       my \@lines =      split (/\\n/, \$h->{\$k})       ;\n       my \$line = shift \@lines;\n       \$line =~ s/=head.\\s*//;\n       \$d .= \"L<\".\$k.\"> \".\$line; \n       \$d .= \"\\n\\n\";\n       }\n     \$d .= \"\\n=back\\n\";\n   return \$d;\n   }");
$o->jaddSlot("callback_delete" => "sub{\ndelete \$s->wikiData->{\$s->current_page};\n\$s->current_page(\"Home\");    \n\$s->load_page(\$s->current_page);        \n}\n");
$o->jaddSlot("initialise" => "sub{\nmy %h=();\n\$h{Home} = \"Home page\";\n\$h{ notFound} = '=head1 Create a new page?\n\nYou have followed a link to a page that doesn\\'t exist yet.  Click edit to create this new page.\nTry it, it\\'s easy and fun!  Well, easy and amusing, maybe.  Ok, not amusing, but not terrible either.\nLook, I like writing documentation.  Don\\'t judge me.';\n;\n\$s->wikiData(\\%h);\n}");
$o->jaddSlot("wikiStart" => "sub{\n  \neval'\npackage Prima::PodView;\n\nsub load_file\n{                                                       \n\n        my ( \$self, \$page) = \@_;\n        \$self->{myWikiCallback}( \$page);\n                                            \n                                               \n}\n';     \n   \n\n\nmy \$window = Prima::Window-> create(size     => [ 600, 450]);\nmy \$nb = \$window->insert( TabbedScrollNotebook =>                               \n        pack => { fill => 'both', expand => 1, padx=>10, pady=>10 },             \n        pageCount =>2,                       \n        \n       \n        tabs => [ 'View', 'Edit' ],\n);\nmy \$podview = \$nb-> insert_to_page( 0 =>   \n       \n        \"Prima::PodView\",\n        pack => { fill => 'both', expand => 1 }\n        ,);        \n\$podview->{myWikiCallback} = sub { my \$p = shift;  \$s->load_page(\$p) };        \n\$nb-> insert_to_page( 0 =>        \n        [\"Prima::Button\",\n                owner => \$window,\n                text  => 'Edit',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_edit},\n       ]\n\n        );                                               \n\n\$nb-> insert_to_page( 0 =>        \n        [\"Prima::Button\",\n                owner => \$window,\n                text  => 'Back',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_back},\n       ]\n\n        );                                               \n\n\nmy \$podedit = \$nb-> insert_to_page( 1, \"Prima::Edit\"    ,\n        pack => { fill => 'both', expand => 1 }   \n);\n        \n\$nb-> insert_to_page( 1, \"Prima::Button\"    ,\n                text  => 'Save',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_save},\n);\n        \$nb-> insert_to_page( 1 =>        \n        [\"Prima::Button\",\n                owner => \$window,\n                text  => 'Delete Page',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_delete},\n       ]\n\n        );\n\n#\$nb->Notebook->backColor( cl::Green);\n#\$nb->use_current_size;                                 \n                                  \n        \n\$s->widget_edit(\$podedit);   \n\$s->widget_edit(\$podedit);   \n\$s->widget_podview(\$podview);                      \n\$s->widget_notebook(\$nb);\n\$s->widget_window(\$window);\n#\$s->current_page(\"Home\");\n\$s->load_page(\$s->current_page);\n\n    }");
$o->jaddSlot("page_history" => "sub{\n  warn(\"FAIL:  page_hsitory in wiki should be implemented by its children\");\n  }");
$o->jaddSlot("callback_back" => "sub{\n  my \$ph = \$s->page_history;\n  if ( scalar(\@{\$ph}))\n  { \n  my \$page = pop \@{\$ph};\n  \$s->load_page(\$page);\n  pop \@{\$ph};\n  }}");
$o->jaddSlot("load_page" => "sub{ \nmy \$podview = \$s->widget_podview;  \nmy \$page = \$_[1];  \n        push \@{\$s->page_history}, \$s->current_page;         \n\$s->current_page(\$page);\n       print \"Loading page \$page\\n\";   \nmy \$data = \$s->wikiData->{\$page};   \nif ( \$page eq \"Table of Contents\")\n  {\n    \$data = \$s->make_index;}\n\$data ||= \$s->wikiData->{notFound};\n        \$podview->open_read;\n        \$podview-> read(\$data.\"\\n\\nGo L<Home> or to the L<Table of Contents>\");\n        \$podview-> close_read;    \n        \$s->widget_edit->text(\$data);   \n        \$s->widget_window->text(\$page);\n\n    }\n  ");



#Object: GuiInheritenceEditor
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("tagline" => "\"I\ display\ an\ object\ in\ a\ window\"");
$o->jaddSlot("target" => "undef");
$o->jaddSlot("selected_method" => "\"inspector\*\"");
$o->jaddSlot("objectlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methedit" => "bless\(\ \{\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame1\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("errorbox" => "bless\(\ \{\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame2\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("i_am_a" => "\"GuiInheritenceEditor\"");
$o->jaddSlot("parent_name" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.entry\"\
\}\,\ \'Tk\:\:Entry\'\ \)");
$o->jaddSlot("parent_target" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.entry1\"\
\}\,\ \'Tk\:\:Entry\'\ \)");
$o->jaddSlot("display_parent" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("window" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.\"\
\}\,\ \'MainWindow\'\ \)");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "13");
#Methods: 
$o->jaddSlot("go" => "sub{\n\t\$s->target(\$s->find(\"GuiBrowser\"));\n\t\$s->gstartup;\n\t\$s->display_objs;\n\t\$s->display;\n\t}");
$o->jaddSlot("update" => "sub{\n#eval{\nprint \"Updating \".\$s->target->i_am_a.\"'s method \".\$s->selected_method.\" with \". \$s->methedit->Contents .\"\\n\";\nif(\$s->check_eval)\n{\$s->target->jaddSlot(\$s->selected_method, \$s->methedit->Contents);}\n\n}");
$o->jaddSlot("check_eval" => "sub{\n\t\n\tmy \$code = \t\$s->methedit->Contents;\n\t\$\@ = undef;\n\teval \$code;\n\tif (\$\@)\n\t\t{print \$\@, \"\\n\";\$s->errorbox->Contents(\$\@);return undef;}\n\t\t\$s->errorbox->Contents(\"Your code compiled cleanly\");\n\treturn 1;\n\t}");
$o->jaddSlot("display_objs" => "sub{\n\t\t  foreach my \$o (\@{\$s->oblist()})\n\t\t{\$s->objectlist->insert(0,\$o->i_am_a)}}");
$o->jaddSlot("sm" => "sub{\n\tmy \$method = \$_[1];\n\tmy \$data = \$_[2];\n\t#print \$method, \$data;\n\tmy \$fr = \$s->wh->Frame();\$fr->pack(-anchor=>'n', -side=>'top');\n\tmy \$text = \$fr -> Label(-text=>\$method);\$text->pack(-anchor=>\"w\", -side=>\"left\" );\n\t;\n\tmy \$text2 = \$fr -> Scrolled('Text', -height=>10, -width=>80);\$text2->pack( -anchor=>\"e\", -side=>\"right\");\$text2->Contents(\$data);\n\t\n\tmy \$button = \$fr->Button(-text=>\"Update\", -command=>sub {\$s->jaddSlot(\$method => \$text2->Contents);}); \$button->pack();\n\t}");
$o->jaddSlot("display" => "sub{\n\tforeach my \$method (\$s->target->reflect->slotNames)\n        {\n      next unless ( \$method =~ /\\*\$/);\n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->methlist->insert(0, \$method );\n        \n          }}\n\t\t  }\n");
$o->jaddSlot("clear_methods" => "sub{\n\t\$s->methlist->delete(0,\"end\");\n\n\t}\n");
$o->jaddSlot("set_parent" => "sub{\n\t\$s->target->reflect->addSlot(\n\t\t\$s->parent_name->get, \n\t\t\$s->objsearch(\$s->parent_target->get));}\n\n\n\n\n");
$o->jaddSlot("gstartup" => "sub{my \$top = MainWindow->new; \n\t\$s->window(\$top);\n#\tmy \$text = \$top -> Scrolled('Text');\$text->pack(-anchor=>\"n\", -side=>\"top\" );\n#\t\$s->in_handle(\$text);\n#\tmy \$text2 = \$top -> Scrolled('Text');\$text2->pack( -anchor=>\"s\", -side=>\"bottom\");\n#\t\$s->res_handle(\$text2);\n\t\n\tmy \$fr = \$top->Frame;\$fr->pack(-anchor=>'n', -side=>'top', -fill=>'both', -expand=>1);\n\tmy \$objectlist = \$fr->Scrolled(\"Listbox\");\$objectlist->pack(-anchor=>'w', -side=>'left', -fill=>'both', -expand=>1);\n\t\$objectlist -> bind ('<<ListboxSelect>>', sub{\$s->clear_methods;\$s->target(\$s->find(\$objectlist->get(\$objectlist->curselection)));\$s->display;});\n\n\tmy \$methfr = \$fr->Frame;\$methfr->pack();\n\tmy \$methlist = \$methfr->Scrolled(\"Listbox\");\$methlist->pack(-anchor=>'w', -side=>'left', -fill=>'both', -expand=>1);\n\tmy \$newmeth = \$methfr->Entry; \$newmeth->pack();\n\tmy \$newpar = \$methfr->Entry; \$newpar->pack();\n\tmy \$newmethbut = \$methfr->Button(-text=>\"Set parent\", -command=>sub{\$s->set_parent});\$newmethbut->pack();\n\n\t\$methlist -> bind ('<<ListboxSelect>>', sub{\$s->display_slot(\$methlist->get(\$methlist->curselection))});\n\tmy \$button = \$top->Button(-text=>\"Update\", -command=>sub {print \"Running update\"; \$s->update;}); \$button->pack();\n\t\$s->objectlist(\$objectlist);\n\t\$s->methlist(\$methlist);\n\t\$s->parent_name(\$newmeth);\n\t\$s->parent_target(\$newpar);\n\tprint \"Graphics started\\n\";\n\t}\n\n\n\n\n");
$o->jaddSlot("display_slot" => "sub{\n\tmy \$method = \$_[1];\n\t  \$s->selected_method(\$method);\n\tif (\$s->target->reflect->slotType(\$method) eq 'PARENT')\n\t{\n        \tmy (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n       my \$target_obj= \$slot->{value};\n        print \"Found target object \". \$target_obj->i_am_a. \"\\n\";\n\t\$s->parent_target->delete(0,'end');\n\t\$s->parent_target->insert(0, \$target_obj->i_am_a);\n\t\$s->parent_name->delete(0, 'end');\n\t\$s->parent_name->insert(0, \$method);\n\$s->window->configure(-title=>\"Link: \".\$s->target->i_am_a.\" -> \".\$method . \" -> \" . \$target_obj->i_am_a);\n\n          }\n\t\t  }}\n\n\n\n\n");



#Object: Documentation
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Documentation\"");
$o->jaddSlot("" => "\"Welcome\ to\ Perl\ LiveObjects\.\\n\\nLiveObjects\ is\ a\ system\ that\ allows\ you\ to\ edit\ objects\ \(and\ the\ running\ program\)\.\ \ It\ works\ \\nsimilar\ to\ Smalltalk\ and\ Self\.\ \ But\ because\ it\ is\ all\ in\ Perl\,\ you\ don\'t\ have\ to\ learn\ anything\ new\.\\n\\nWell\,\ not\ much\.\\n\\nIf\ you\ are\ familiar\ with\ Squeak\ Smalltalk\ or\ Self\,\ read\ the\ \'Important\'\ note\,\ then\ get\ cracking\.\ \ Otherwise\\nyou\ might\ like\ to\ start\ with\ the\ \'Introduction\'\"");
$o->jaddSlot("widget_edit" => "undef");
$o->jaddSlot("widget_notebook" => "undef");
$o->jaddSlot("widget_podview" => "undef");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("wikiData" => "\{\
\ \ \"Quick\ Start\"\ \=\>\ \"\=head1\ Quick\ Start\\n\\nThere\ are\ some\ extra\ things\ you\ need\ to\ know\ to\ work\ in\ this\ environment\ \.\.\.\\n\\nTo\ start\ with\,\ open\ up\ the\ Evaluator\ from\ the\ menu\,\ and\ enter\ and\ run\\n\\n\ \\\$s\-\>find\(\\\"ObjectReference\\\"\)\-\>go\;\\n\ \\nThe\ evaluator\ runs\ perl\ code\ inside\ the\ current\ program\.\ \ The\ line\ above\ shows\ most\ of\ the\ features\ you\ need\ to\ \\nknow\ to\ use\ LiveObjects\.\ \ \\\$s\ is\ always\ the\ current\ object\.\ \ \-\>find\(\)\ is\ a\ universal\ method\ that\ you\ can\ always\ use\\nto\ lookup\ a\ Prototype\ object\.\ \ All\ application\-style\ objects\ start\ when\ you\ call\ \-\>go\(\)\ on\ them\.\\n\\nTo\ get\ familiar\ with\ the\ system\,\ let\'s\ make\ a\ new\ object\ to\ open\ the\ object\ reference\.\ \ Start\ by\ opening\ the\ \\n\\\"Object\ Manager\\\"\.\ \ Type\ \\\"ReferenceLauncher\\\"\ into\ the\ text\ box\,\ then\ click\ \\\"New\ Object\\\"\.\ \ There\ should\ now\\nbe\ an\ object\ called\ \\\"Copy\ of\ ReferenceLauncher\\\"\.\ \ Select\ it\ then\ click\ \\\"Edit\ Object\\\"\.\\n\\nA\ new\ window\ opens\,\ with\ your\ new\ object\ selected\.\ \ You\ can\ see\ the\ methods\ it\ contains\ in\ the\ middle\ pane\.\\nTry\ changing\ the\ tagline\ for\ your\ object\ by\ selecting\ \\\"tagline\\\"\,\ typing\ a\ new\ message\ then\ \\\"Update\ Object\\\"\.\\nNow\ in\ the\ text\ box\,\ type\ \\\"go\\\"\ and\ click\ \\\"Add\ Method\\\"\.\ \ Select\ the\ new\ method\ \'go\'\ from\ the\ list\,\ then\ enter\ and\ update\:\\n\\n\ \ sub\{\ \\\$s\-\>find\(\\\"ObjectReference\\\"\)\-\>go\;\ \}\\n\ \ \\nmake\ sure\ that\ the\ first\ 4\ letters\ are\ \'sub\{\'\.\ \ Now\ add\ methods\ \\\"isApplication\\\"\ and\ \\\"humanName\\\"\.\ \ Set\ humanName\\nto\ \\\"Launch\ Object\ Reference\\\"\.\ \ Now\ shutdown\ and\ restart\ LiveObjects\.\ \ Make\ sure\ you\ shut\ down\ with\ the\ Shutdown\ \\nbutton\ on\ the\ menu\!\\n\\nHopefully\ when\ you\ restart\,\ you\ will\ have\ a\ new\ button\ that\ allows\ you\ to\ launch\ the\ object\ reference\.\\n\\nSo\ what\'s\ going\ on\ here\?\\n\\n\=head2\ \\\$s\ \\n\\nIn\ each\ method\,\ \\\$s\ is\ automatically\ set\ to\ the\ current\ object\.\ \ So\ is\ \\\$_\[0\]\.\ \ There\ is\ a\ simple\ search\ and\ replace\\nfor\ methods\.\ \ If\ your\ method\ definition\ starts\ with\ sub\{\ then\ it\ is\ replaced\ with\ sub\{my\ \\\$s\ \=\ \\\$_\[0\]\;\.\ \ If\ you\ put\\nanything\ between\ the\ sub\ and\ the\ \{\,\ this\ will\ fail\,\ so\ do\ not\ do\ that\.\\n\\n\ sub\{\ print\ \\\$s\ \-\>\ i_am_a\}\ \ \#Prints\ the\ name\ of\ the\ current\ object\\n\\n\=head2\ find\(\)\\nEvery\ object\ has\ BootObj\ as\ a\ parent\.\ \ BootObj\ provides\ handy\ routines\ like\ find\,\ which\ looks\ up\ a\ object\ for\ you\:\\n\\n\ my\ \\\$ni\ \=\ \\\$s\-\>find\(\\\"NetImage\\\"\)\;\\n\ \\\$ni\-\>show\;\\n\\n\\\$s\-\>find\(\)\ looks\ up\ objects\ in\ the\ prototype\ list\.\ \ LiveObjects\ keeps\ a\ list\ of\ Prototypes\.\ \ Unlike\ usual\ object\\nsystems\,\ there\ are\ no\ classes\ here\!\ \ To\ make\ new\ objects\,\ you\ clone\ an\ existing\ one\.\ \ Usually\,\ you\ will\ clone\ a\ \\nPrototype\ object\.\ \ Prototypes\ are\ normal\ objects\ in\ every\ way\ \(you\ can\ call\ methods\ on\ them\)\,\ but\ the\ LO\ system\\ntreats\ them\ specially\.\\n\ \\n\=head2\ Prototypes\ and\ Clones\\n\\n\ my\ \\\$ni\ \=\ \\\$s\-\>find\(\\\"NetImage\\\"\)\;\\n\ my\ \\\$doppel\ \=\ \\\$ni\-\>clone\;\\n\ \\\$ni\-\>show\;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \\n\ \\\$doppel\-\>show\;\\n\\nNotice\ that\ in\ the\ examples\,\ we\ are\ using\ Prototype\ objects\ to\ do\ things\.\ \ This\ is\ because\ all\ objects\ are\ real\\nworking\ objects\,\ all\ the\ time\.\ \ However\ there\ are\ some\ objects\ that\ you\ will\ clone\ often\,\ so\ they\ are\ kept\ on\ \\nthe\ Prototype\ list\.\\n\\nNote\ that\ currently\ clones\ are\ not\ saved\ and\ reloaded\ between\ sessions\.\ \ Only\ prototypes\ are\ kept\.\\n\\n\=head2\ Graphics\\n\\nThe\ graphics\ are\ unchanged\,\ unwrapped\ Prima\ graphics\.\ \ To\ do\ graphics\,\ like\ open\ a\ window\ or\ add\ a\ button\,\ \\nplace\ the\ appropriate\ Prima\ calls\ in\ a\ method\,\ then\ call\ the\ method\ \(the\ Evaluator\ is\ great\ for\ this\)\.\ \ By\ habit\ I\ place\\nmy\ graphics\ calls\ inside\ a\ method\ called\ \'gstartup\'\,\ so\ look\ at\ a\ few\ existing\ objects\.\\n\\nNote\ that\ you\ should\ store\ all\ your\ graphics\ objects\ in\ methods\ that\ start\ with\ \-\>widget_\ \,\ this\ ensures\ they\ will\\nbe\ destroyed\ correctly\ at\ the\ right\ time\.\\n\\n\=head2\ Finally\ \\n\\nLiveObjects\ uses\ straight\ Perl\ everywhere\.\ \ The\ object\ system\ is\ provided\ by\ Class\:\:Prototyped\ so\ you\ use\ normal\\nperl\ syntax\ to\ access\ them\.\ \ \.\ \ My\ goal\ was\ to\ get\ this\\nsystem\ working\ without\ having\ to\ tinker\ inside\ support\ modules\ or\ write\ complex\ slip\ layers\.\ \ Much\ to\ my\ surprise\,\ \\nthis\ worked\.\ \ Yay\ Perl\.\\n\ \"\,\
\ \ \"Quirks\"\ \=\>\ \"\=head1\ Quirks\\n\\nLiveObjects\ is\ inspired\ by\ Smalltalk\,\ but\ it\ is\ very\ different\ in\ operation\.\ \ Where\ Smalltalk\\nlives\ in\ a\ kind\ of\ walled\ garden\,\ avoiding\ dealing\ with\ the\ grubby\ processes\ that\ populate\ the\ rest\ of\ a\\nusual\ computer\ system\,\ Perl\ likes\ to\ get\ up\ close\ and\ friendly\.\ \ LiveObjects\ attempts\ to\ follow\ that\ lead\.\\n\\nSockets\,\ files\ and\ databases\ have\ to\ be\ opened\ and\ closed\ at\ the\ right\ time\.\ \ Modules\ have\ to\ be\ loaded\,\ \\nand\ graphics\ resources\ have\ to\ be\ managed\ carefully\.\ \ It\'s\ not\ a\ pretty\ sight\.\ \ I\'ve\ tried\ to\ construct\ the\ system\\nwithout\ changing\ any\ external\ resources\ because\ I\ don\'t\ want\ to\ end\ up\ maintaining\ them\.\ \ This\ has\ led\ to\ some\\nodd\ designs\ within\ LiveObjects\.\ \ Read\ on\ to\ find\ out\ what\.\ \\n\\n\=head2\ C\ Pointers\\nThe\ biggest\ problem\ so\ far\ are\ datastructures\ containing\ C\ pointers\.\ \ It\ doesn\'t\ happen\ too\ often\,\ but\ sometimes\\na\ module\ will\ return\ a\ C\ pointer\,\ that\ gets\ kept\ in\ a\ Perl\ scalar\.\ \ Normally\ these\ pointers\ vanish\ when\ the\ program\ exits\,\ \\njust\ like\ every\ other\ normal\ program\.\ \ But\ in\ LiveObjects\,\ we\ save\ all\ our\ datastructures\ and\ reload\ them\ on\ the\ next\ run\.\\nThis\ leads\ to\ C\ pointers\ that\ point\ to\ unallocated\ memory\.\ \ Kaboom\.\\n\\nIf\ you\'re\ not\ too\ sure\ about\ what\ that\ last\ paragraph\ means\,\ just\ make\ sure\ you\ keep\ your\ graphics\ widgets\ in\ method\ slots\\nthat\ start\ with\ \\\"widget_\\\"\.\ \ e\.g\.\ \\n\ \ \\\$s\-\>widget_window\ \\n\ \ \\\$s\-\>widget_mybutton\\n\\nPrima\ in\ particular\ keeps\ a\ lot\ of\ C\ pointers\ perl\ side\ \,\\nand\ if\ they\ are\ not\ all\ tracked\ down\ before\ the\ L\<image\>\ is\ saved\,\ they\ will\ cause\ a\ crash\ sometime\\nafter\ LiveObjects\ is\ restarted\.\ \ To\ help\ with\ this\,\ I\ keep\ every\ Prima\ widget\ in\ a\ slot\ that\ starts\ with\\n\\\"widget_\\\"\.\ \ As\ the\ system\ shuts\ down\,\ it\ scans\ every\ object\ and\ undefs\ every\ slot\ whose\ name\ begins\ with\ \\n\\\"widget_\\\"\.\ \ \ I\'m\ thinking\ there\ should\ be\ an\ attribute\ attached\ to\ each\ slot\ that\ needs\ to\ be\ wiped\.\ \ \\n\\nIf\ LiveObjects\ starts\ crashing\ for\ no\ apparent\ reason\ \(particularily\ during\ shutdown\)\,\ you\ probably\ have\\na\ dangling\ C\ pointer\ stored\ in\ a\ slot\ somewhere\.\ \ I\ usually\ give\ up\ and\ go\ back\ to\ a\ previous\ snapshot\\nbecause\ a\ dangling\ pointer\ hidden\ in\ a\ perl\ variable\ is\ very\ difficult\ to\ find\.\ \ \ \ \ \ \ \ \ \ \\n\\n\=head2\ Object\ References\\n\\nYou\ must\ store\ LiveObjects\ \(Class\:\:Prototyped\ objects\)\ in\ object\ slots\.\ \ Storing\ them\ inside\ perl\ data\ structures\ \(like\ hashes\ or\ arrays\)\\nwill\ result\ in\ them\ being\ written\ out\ with\ Data\:\:Dumper\ and\ when\ they\ get\ read\ back\ in\,\ all\ sorts\ of\ things\ go\ horribly\ wrong\.\\n\\nWhen\ LiveObjects\ shuts\ down\,\ it\ searches\ every\ slot\ in\ every\ object\ for\ references\ to\ other\ objects\,\ and\ replaces\ them\ with\ code\ that\\nwill\ re\-link\ them\ properly\ next\ startup\.\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\n\\nNote\ that\ holding\ LiveObjects\ in\ a\ temporary\ variable\ during\ a\ subroutine\ is\ fine\.\ \ Just\ don\'t\ make\ an\ array\ of\ LiveObjects\ \ and\ then\ store\ the\ array\\nin\ an\ object\ slot\.\"\,\
\ \ \"notFound\"\ \=\>\ \"\=head1\ Create\ a\ new\ page\?\\n\\nYou\ have\ followed\ a\ link\ to\ a\ page\ that\ doesn\'t\ exist\ yet\.\ \ Click\ edit\ to\ create\ this\ new\ page\.\\nTry\ it\,\ it\'s\ easy\ and\ fun\!\ \ Well\,\ easy\ and\ amusing\,\ maybe\.\ \ Ok\,\ not\ amusing\,\ but\ not\ terrible\ either\.\\nLook\,\ I\ like\ writing\ documentation\.\ \ Don\'t\ judge\ me\.\"\,\
\ \ \"Home\"\ \=\>\ \"\=head1\ Home\\n\\n\=head2\ LiveObjects\ \-\ Integrated\ development\ and\ deployment\\n\\nLiveObjects\ contains\ a\ graphical\ IDE\ that\ you\ use\ to\ modify\ the\ LiveObjects\ system\ until\ it\ becomes\ the\ application\\nyou\ want\.\ \ \ It\ works\ similar\ to\ Smalltalk\ and\ Self\.\ \ But\ because\ it\ is\ all\ in\ Perl\,\ you\ don\'t\ have\ to\ learn\ anything\ new\.\ \ \\nWell\,\ not\ much\.\\n\\nIf\ you\ are\ familiar\ with\ Squeak\ Smalltalk\ or\ Self\,\ read\ the\ L\<Quirks\>\ note\,\ then\ get\ cracking\.\ \ Otherwise\\nyou\ might\ like\ to\ start\ with\ the\ L\<Quick\ Start\>\.\ \\n\\nYou\ could\ read\ some\ tips\ on\ L\<Deploying\ an\ application\>\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\nThere\'s\ a\ longer\ L\<Introduction\>\ for\ thems\ who\ care\ about\ what\ I\ was\ trying\ to\ do\,\ and\ an\ explanation\ of\ L\<how\ it\\nall\ works\>\ which\ is\ good\ reading\ if\ you\ want\ to\ tinker\ with\ the\ insides\.\\n\\nRead\ the\ L\<License\>\ or\ the\ story\ of\ LiveObjects\ L\<Genesis\>\.\ \ There\ are\ some\ L\<Things\ to\ Do\>\,\ and\ some\ L\<Thanks\>\ to\ give\.\"\,\
\ \ \"how\ it\ all\ works\"\ \=\>\ \"\=head1\ How\ it\ all\ works\\n\\n\=head2\ Boot\\n\\nImmediately\ upon\ starting\,\ LiveObjects\ loads\ Class\:\:Prototyped\ and\ creates\ a\ fresh\ Class\:\:Prototyped\ object\ called\\nthe\ \\\"BootObject\\\"\.\ \ LO\ immediately\ adds\ a\ method\ to\ the\ BootObject\ called\ \\\"jaddSlot\\\"\.\ \ jaddSlot\ functions\ just\ like\\nthe\ usual\ addSlot\ method\,\ but\ in\ addition\ to\ adding\ a\ new\ method\ to\ an\ object\,\ it\ tucks\ the\ source\ code\ for\ the\ \\nmethod\ away\ inside\ an\ attribute\ \(the\ description\ attribute\)\.\ \ \\nWhen\ it\ comes\ time\ to\ save\ the\ objects\ back\ to\ disc\,\ LO\ saves\ the\ source\ code\\ninstead\ of\ the\ compiled\ method\.\\n\\nThis\ is\ the\ same\ technique\ used\ for\ adding\ variable\ slots\ to\ objects\,\ but\ when\ the\ variable\ slots\ are\ saved\,\ LO\ dumps\\nthe\ current\ value\ and\ not\ the\ \'source\ code\'\.\\n\\nMost\ of\ the\ file\ now\ is\ calls\ to\ jaddSlot\ as\ LO\ builds\ the\ objects\ one\ method\ at\ a\ time\.\ \ Once\ all\ the\ objects\ are\ complete\,\\nLO\ starts\ linking\ them\ up\ correctly\.\ \ At\ the\ end\ of\ the\ file\ are\ some\ routines\ that\ add\ parent\ objects\ to\ the\ correct\ objects\,\\nand\ restore\ object\ pointers\.\\n\ \\nHow\ does\ LO\ know\ which\ objects\ are\ parents\,\ and\ which\ are\ linked\ through\ variable\ slots\?\ \ When\ LO\ saves\ itself\,\\nit\ examines\ all\ the\ objects\ it\ knows\ about\ and\ writes\ out\ the\ correct\ code\ to\ rebuild\ the\ links\.\\n\\nWhy\ don\'t\ we\ use\ Data\:\:Dumper\ for\ all\ this\?\ \ Mainly\ because\ Data\:\:Dumper\ can\'t\ dump\ subroutines\.\ \ If\ it\ could\,\ \\nthis\ would\ be\ so\ much\ easier\.\\n\\nAfter\ the\ objects\ are\ all\ linked\ up\,\ LO\ calls\ \-\>startup\ on\ each\ object\ in\ random\ order\.\\n\\nFinally\,\ LO\ calls\ \-\>boot\ on\ the\ BootObject\,\ \-\>boot\ calls\ PrimaMenu\ and\ the\ system\ is\ off\ and\ running\.\\n\\n\=head2\ Shutdown\\n\\nThe\ shutdown\ procedure\ is\ somewhat\ complicated\,\ and\ starts\ with\ a\ call\ to\ BootObject\-\>snapshot\.\ \ LO\ scans\\nevery\ object\ and\ notes\ which\ objects\ are\ parents\ of\ each\ other\ and\ stores\ these\ relationships\ \(in\ a\ nested\ hash\)\.\\nIn\ the\ same\ pass\,\ every\ object\ is\ assigned\ a\ serial\ number\,\ which\ is\ used\ at\ next\ startup\ to\ find\ the\ parents\ again\.\\n\\nNow\ LO\ calls\ serialise\ on\ every\ object\.\ \ Serialise\ finds\ the\ source\ code\,\ or\ dumps\ the\ current\ value\ for\ each\ slot\.\\nIf\ the\ slot\ points\ at\ another\ object\,\ it\ is\ noted\ in\ the\ parent\ link\ hash\,\ and\ the\ slot\ is\ set\ to\ undef\.\ \ If\ we\ don\'t\ do\ this\\nthen\ the\ objects\ will\ be\ dumped\ in\ full\,\ leading\ to\ a\ massive\ blow\ out\ in\ file\ size\ \(usually\ 100x\)\.\\n\\nAdding\ the\ variable\ slots\ to\ the\ parent\ hash\ is\ a\ nasty\ \\ntrick\ LO\ can\ get\ away\ with\ because\ parent\ slots\ and\ variable\ slots\ are\ added\ to\ objects\ using\ the\ same\ call\,\ and\ \\nClass\:\:Prototyped\ knows\ the\ difference\ because\ all\ parent\ slots\ have\ names\ that\ end\ in\ a\ \*\.\ \ e\.g\.\ \\n\\n\ \\\$object\-\>addSlot\(\'some_words\*\'\,\ \\\$another_object\)\;\ \ \#a\ parent\ slot\\n\ \\\$object\-\>addSlot\(\'some_words\'\,\ \\\$another_object\)\;\ \ \#a\ normal\ variable\ slot\\n\ \\nAnyway\,\ having\ serialised\ every\ object\,\ LO\ writes\ the\ necessary\ code\ to\ start\ file\,\ all\ the\ serialised\ objects\ and\ then\\nthe\ links\ patchup\ code\.\ \ And\ we\'re\ ready\ to\ go\ again\.\ \ \ \"\,\
\ \ \"License\"\ \=\>\ \"\=head1\ License\\n\\nThis\ kind\ of\ self\ modifying\ program\ ends\ up\ being\ full\ of\ personal\ data\ and\ customisations\ \\nthat\ only\ matter\ to\ you\.\ \ As\ such\,\ there\ is\ no\ \ license\ \ that\ could\ possibly\ cover\ its\ use\.\ \ So\.\.\.\\n\\n\=head2\ I\ hereby\ release\ this\ software\ into\ the\ public\ domain\.\\n\\nIt\ belongs\ to\ you\ now\.\ \ Congratulations\!\ \ \ \ \ \ \ \ \ \ \\n\\nNB\:\ \ Accompanying\ modules\ are\ not\ public\ domain\!\ \ In\ particular\,\ the\ two\ modules\ LiveObjects\ heavily\ relies\ on\ \(\\nClass\:\:Prototyped\ and\ Prima\)\ are\ copyrighted\ to\ their\ respective\ authors\ and\ are\ not\ public\ domain\ although\ they\\nare\ open\ source\.\"\,\
\ \ \"Deploying\ an\ application\"\ \=\>\ \"\=head1\ Deploying\ an\ Application\\n\\nDeploying\ an\ application\ using\ the\ LiveObjects\ system\ is\ in\ theory\,\ fairly\ simple\.\ \ To\ start\ with\,\ create\ an\ internal\\napplication\.\ \ For\ full\ details\ on\ this\,\ see\ the\ L\<Quick\ Start\>\ page\.\ \ \\\"Applications\\\"\ are\ just\ objects\ with\ an\ \-\>isApplication\ \\nproperty\ set\ to\ true\.\ \ They\ have\ a\ go\ method\,\ which\ predictably\ starts\ them\.\ \ And\ they\ have\ a\ humanName\ property\,\\nso\ people\ know\ what\ they\ are\ using\.\\n\\nOnce\ you\ have\ your\ application\ tested\ and\ running\ smoothly\,\ open\ up\ the\ BootObject\ object\ in\ the\ Object\ Editor\.\\nEdit\ the\ \-\>autoApplication\ method\ and\ put\ the\ name\ of\ your\ application\ object\ there\.\ \ That\ is\,\ the\ object\ name\,\ not\\nthe\ humanName\.\\n\ \ \ \ \ \ \ \\n\ \ \ \ \ \ \ \\nNow\ select\ shutdown\ from\ the\ main\ menu\.\ \ The\ next\ time\ LiveObjects\ starts\,\ it\ will\ load\ your\ application\ instead\.\\nDon\'t\ forget\ to\ add\ a\ menu\ item\ to\ your\ program\ that\ calls\ PrimaMenu\ so\ you\ can\ switch\ back\!\\n\"\,\
\ \ \"image\"\ \=\>\ \"\=head1\ The\ Image\\n\\nMost\ Smalltalks\,\ and\ some\ Lisps\,\ can\ save\ the\ running\ program\ to\ disc\,\ along\ with\ all\ its\ data\\nand\ current\ state\.\ \ This\ save\ file\ \ is\ called\ an\ \'image\'\.\ I\ really\ like\ this\ for\ small\ projects\,\ and\ I\ wanted\ it\ in\ Perl\.\\n\\nHowever\ I\ don\'t\ have\ the\ skills\ to\ alter\ Perl\ to\ do\ this\.\ \ It\ looks\ very\ difficult\,\\nsince\ there\ have\ been\ several\ unsuccessful\ attempts\ at\ it\ by\ people\ smarter\ than\ me\.\ \ So\ I\ cheated\.\\n\\nInstead\ of\ really\ saving\ the\ program\ to\ disc\,\ it\ watches\ what\ you\ do\,\ and\ then\ writes\ that\ to\ a\ file\.\\nNext\ time\ the\ program\ runs\,\ it\ rebuilds\ itself\ then\ continues\ running\.\\n\\nActually\,\ it\ isn\'t\ even\ that\ clever\.\ \ What\ it\ actually\ does\ is\ save\ the\ source\ of\ new\ code\ that\\nyou\ enter\,\ and\ writes\ that\ out\ alongside\ Data\ Dumper\ output\ of\ the\ current\ data\ structures\.\ \ Have\\na\ look\ inside\ the\ program\ file\ to\ reveal\ the\ true\ horror\.\ \"\,\
\ \ \"Thanks\"\ \=\>\ \"\=head1\ Thanks\\n\\nA\ big\ thanks\ to\ the\ writers\ of\ Class\:\:Prototype\,\ Prima\,\ and\ Smalltalk\.\ \ Also\ to\ all\ the\ perlmonks\ who\ have\ put\ up\ with\ my\\nsilly\ questions\ and\ been\ encouraging\ and\ supportive\.\"\,\
\ \ \"Genesis\"\ \=\>\ \"\=head1\ Genesis\\n\\nFor\ some\ reason\,\ a\ lot\ of\ projects\ have\ a\ section\ describing\ how\ and\ why\ they\ were\ created\.\ \ \\nWho\ am\ I\ to\ buck\ a\ trend\?\\n\\nI\ created\ LiveObjects\ because\ I\ wanted\ the\ functionality\ and\ convenience\ of\ Smalltalk\,\ but\ with\ access\ to\ Perl\'s\\nhuge\ library\ of\ modules\.\ \ I\ also\ wanted\ a\ pleasant\ GUI\ to\ write\ Perl\ in\,\ and\ I\ wanted\ that\ GUI\ to\ be\ written\ in\ Perl\,\\nso\ I\ could\ extend\ it\ easily\.\ \ This\ is\ the\ most\ successful\ of\ my\ \(many\)\ attempts\ to\ write\ a\ useful\ Perl\ GUI\.\\n\ \"\,\
\ \ \"Important\"\ \=\>\ \"\=head1\ Important\ notes\ on\ LiveObjects\\n\\nThe\ biggest\ problem\ so\ far\ are\ datastructures\ containing\ C\ pointers\.\ \ Prima\ in\ particular\ is\ full\ of\ \\nthem\,\ and\ if\ they\ are\ not\ tracked\ down\ before\ the\ \\\"image\\\"\ is\ saved\,\ they\ will\ cause\ a\ crash\ sometime\\nafter\ LiveObjects\ is\ restarted\.\ \ To\ help\ with\ this\,\ I\ keep\ every\ Prima\ widget\ in\ a\ slot\ that\ starts\ with\\n\\\"widget_\\\"\.\ \ As\ the\ system\ shuts\ down\,\ it\ wipes\ the\ contents\ of\ every\ slot\ whose\ name\ begins\ with\ \\n\\\"widget_\\\"\.\\n\\nIf\ LiveObjects\ starts\ crashing\ for\ no\ apparent\ reason\ \(particularily\ during\ shutdown\)\,\ you\ probably\ have\\na\ dangling\ C\ pointer\ stored\ in\ a\ slot\ somewhere\.\ \ I\ usually\ give\ up\ and\ go\ back\ to\ a\ previous\ snapshot\\nbecause\ finding\ a\ dangling\ pointer\ hidden\ in\ a\ perl\ variable\ is\ very\ difficult\ to\ find\.\\n\\n\"\,\
\ \ \"Things\ to\ Do\"\ \=\>\ \"\=head1\ Things\ to\ do\\n\\n\=over\\n\=item\\nGet\ web\ browser\ working\ better\\n\\n\=item\\nHandle\ attributes\ on\ slots\ \(so\ we\ can\ call\ super\,\ and\ have\ initialisers\)\\n\\n\=item\\nMake\ swankier\ menu\ bar\ \ \\n\=back\"\,\
\ \ \"Introduction\"\ \=\>\ \"\=head1\ Introduction\\n\\nLiveObjects\ is\ an\ adaption\ of\ a\ system\ called\ Smalltalk\.\\nThe\ designers\ of\ smalltalk\ came\ up\ with\ many\ cool\ ideas\,\ like\ Object\ Orientation\,\ Wikis\ and\\na\ rather\ nifty\ window\ system\ for\ editing\ code\ in\ a\ program\ while\ it\ is\ still\ running\.\ \ \\nThey\ also\ have\ a\ neat\ trick\ where\ they\ can\ snapshot\ a\ program\ into\ a\ L\<image\>\,\ and\ later\ on\ \\nload\ the\ image\ and\ continue\ where\ the\ last\ session\ left\ off\.\\n\\nI\ wanted\ the\ code\ editing\ system\ and\ ability\ to\ write\ a\ program\ L\<image\>\ for\ myself\ in\ Perl\.\ \ You\'re\\nlooking\ at\ my\ attempt\ at\ it\ now\.\ \\n\\n\=head2\ Goals\\n\\n\\n\=over\ \\n\=item\ Re\-use\\nWherever\ possible\,\ I\ wanted\ to\ use\ existing\ code\ instead\ of\ reinventing\ wheels\.\\n\=item\ Single\ program\ file\\nI\ like\ the\ idea\ of\ combining\ lots\ of\ fiddly\ little\ files\ into\ one\ convenient\ one\.\\n\=item\ Graphic\-y\ stuff\\nI\ almost\ never\ see\ perl\ doing\ graphics\,\ which\ is\ disappointing\ because\ perl\ is\ pretty\ good\ at\ graphics\.\\n\=item\ On\ the\ fly\ code\ editing\\nPrograms\ should\ be\ more\ aware\ of\ themselves\.\\n\=back\\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\n\=head2\ Program\ Image\ \ \ \ \ \ \ \\n\\nWriting\ a\ program\ L\<image\>\ means\ dumping\ a\ running\ program\ to\ disc\ and\ then\ loading\ it\ later\ to\\ncontinue\ where\ you\ left\ off\.\ \ I\ couldn\'t\ figure\ out\ how\ to\ do\ that\,\ so\ instead\ I\ write\ out\ a\ lot\ of\ perl\\ncommands\ that\,\ when\ run\,\ rebuild\ the\ program\ to\ more\-or\-less\ where\ it\ left\ off\.\ \ With\ a\ bit\ of\ luck\.\\n\\nIt\ works\ most\ of\ the\ time\,\ and\ when\ it\ doesn\'t\ you\ can\ open\ it\ up\ with\ a\ text\ editor\ and\ muck\ about\\n\-\ either\ to\ make\ it\ work\ or\ to\ recover\ some\ data\ you\ really\ need\.\\n\ \ \ \ \ \ \\n\=head2\ \ IDE\ \(The\ Graphic\-y\ Stuff\)\\n\\nSmalltalk\ had\ what\ might\ have\ been\ the\ first\ IDE\,\ and\ certainly\ the\ most\ integrated\ I\ have\\never\ seen\.\ \ Not\ just\ a\ text\ editor\ with\ some\ fancy\ highlighting\,\ it\ was\ designed\ to\ edit\ running\ \\nprograms\.\ \ And\ not\ just\ programs\,\ it\ could\ be\ used\ to\ rebuild\ smalltalk\ itself\,\ while\ it\ was\ running\.\\n\\nThat\'s\ not\ what\ LiveObjects\ does\.\ \ You\ can\'t\ rebuild\ perl\ while\ its\ running\.\ \ But\ you\ can\ create\\nobjects\,\ and\ alter\ the\ program\ as\ it\ runs\.\\n\\n\=head2\ Code\ re\-use\ \ \ \ \ \ \ \ \ \ \\nI\ have\ tried\ hard\ to\ use\ an\ existing\ module\ rather\ than\ writing\ my\ own\,\ which\ has\ so\ far\ lead\ to\ doing\ horrible\\nthings\ like\ like\ overriding\ class\ methods\ inside\ modules\,\ on\ the\ fly\.\ \ It\'s\ still\ been\ quicker\ than\ writing\ my\ own\,\ and\\narguably\ better\ as\ well\.\\n\\nMore\ than\ that\,\ is\ my\ goal\ to\ make\ perl\ modules\ more\ accessable\.\ \ There\'s\ heaps\ of\ fantastic\ perl\ modules\ that\\nare\ mostly\ unknown\ and\ unused\,\ because\ they\'re\ hard\ to\ find\ and\ don\'t\ come\ with\ a\ button\ that\ users\ can\ press\\nto\ see\ them\ work\.\\n\\nI\'d\ like\,\ in\ a\ future\ release\,\ to\ package\ some\ of\ the\ best\ pure\-perl\ modules\ with\ some\ light\ LiveObject\ wrappers\\nso\ people\ can\ just\ press\ a\ button\ to\ see\ them\ work\.\.\.\ then\ flip\ up\ a\ window\ and\ edit\ the\ code\ and\ see\ their\ changes\\nwork\ right\ away\.\\n\\n\=head2\ Introspection\,\ reflection\ and\ programmer\ friendliness\\nWell\ known\ blogger\ Steve\ Yegge\ has\ a\ rather\ good\ essay\ up\ which\ touches\ on\ Living\ code\ vs\.\ Dead\ code\ \(http\:\/\/steve\-yegge\.blogspot\.com\/2007\/01\/pinocchio\-problem\.html\)\.\ \ He\\nargues\ that\ most\ code\ is\ \'dead\ code\'\,\ that\ we\ set\ into\ motion\ like\ a\ zombie\.\ \ It\ comes\ to\ life\,\\nlurches\ along\ for\ a\ bit\ then\ trips\ over\ the\ first\ bump\ and\ faceplants\.\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \\n\\nLive\ code\ has\ a\ different\ feel\.\ \ It\ tends\ to\ be\ smaller\,\ neater\ and\ more\ elegant\ than\ huge\ piles\ of\ dead\ code\.\ \ It\ should\\nbe\ able\ to\ examine\ itself\,\ modify\ itself\ and\ deal\ with\ problems\ in\ more\ sophisticated\ ways\ than\ just\ falling\ over\.\\n\"\
\}");
$o->jaddSlot("current_page" => "\"Quick\ Start\"");
$o->jaddSlot("tagline" => "\"I\ display\ information\ that\ is\ easy\ to\ edit\ and\ navigate\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Documentation\"");
$o->jaddSlot("page_history" => "\[\
\ \ \"License\"\,\
\ \ \"Home\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Things\ to\ Do\"\,\
\ \ \"Things\ to\ Do\"\,\
\ \ \"Things\ to\ Do\"\,\
\ \ \"Things\ to\ Do\"\,\
\ \ \"Home\"\,\
\ \ \"Thanks\"\,\
\ \ \"Thanks\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Home\"\,\
\ \ \"Deploying\ an\ application\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Table\ of\ Contents\"\,\
\ \ \"Deploying\ an\ application\"\,\
\ \ \"Deploying\ an\ application\"\,\
\ \ \"Home\"\,\
\ \ \"Quirks\"\,\
\ \ \"Table\ of\ Contents\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Home\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Table\ of\ Contents\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Home\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Home\"\,\
\ \ \"Introduction\"\,\
\ \ \"Introduction\"\,\
\ \ \"Home\"\,\
\ \ \"how\ it\ all\ works\"\,\
\ \ \"how\ it\ all\ works\"\,\
\ \ \"how\ it\ all\ works\"\,\
\ \ \"Home\"\,\
\ \ \"Deploying\ an\ application\"\,\
\ \ \"Home\"\,\
\ \ \"Genesis\"\,\
\ \ \"Genesis\"\,\
\ \ \"Genesis\"\,\
\ \ \"Home\"\,\
\ \ \"License\"\,\
\ \ \"License\"\,\
\ \ \"License\"\,\
\ \ \"Home\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\,\
\ \ \"Quick\ Start\"\
\]");
$o->jaddSlot("serial_number" => "14");
#Methods: 



#Object: GuiPerldoc
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"GuiPerldoc\"");
$o->jaddSlot("tagline" => "\"I\ display\ perldocs\"");
$o->jaddSlot("subject" => "\"Class\:\:Prototyped\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("content" => "\"\"");
$o->jaddSlot("serial_number" => "15");
#Methods: 
$o->jaddSlot("load" => "sub{my \$cmd = \"perldoc \".\$s->subject; my \$content = `\$cmd`;\$s->content(\$content); print \$content;}");
$o->jaddSlot("gui" => "sub{\$s->load;my \$top = MainWindow->new; \n\tmy \$text = \$top -> Scrolled('Text');\$text->pack(-expand=>1, -fill=>\"both\");\$text->Contents(\$s->content);\n\tmy \$search = \$top->Entry;  \$search->pack();\n\tmy \$button = \$top->Button(-text=>\"Search\", -command=>sub {\$s->subject(\$search->get);\$s->gui;}); \$button->pack();\n\t}");



#Object: GuiBrowser
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"GuiBrowser\"");
$o->jaddSlot("tagline" => "\"I\ display\ an\ object\ in\ a\ window\"");
$o->jaddSlot("target" => "undef");
$o->jaddSlot("selected_method" => "\"shutdown\"");
$o->jaddSlot("objectlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methedit" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame1\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("errorbox" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame2\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("window" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.\"\
\}\,\ \'MainWindow\'\ \)");
$o->jaddSlot("input_method_name" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.entry\"\
\}\,\ \'Tk\:\:Entry\'\ \)");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "16");
#Methods: 
$o->jaddSlot("go" => "sub{\n\t\$s->target(\$s->find(\"GuiBrowser\"));\n\t\$s->gstartup;\n\t\$s->display_objs;\n\t\$s->display;\n\t}");
$o->jaddSlot("update" => "sub{\n#eval{\nprint \"Updating \".\$s->target->i_am_a.\"'s method \".\$s->selected_method.\" with \". \$s->methedit->Contents .\"\\n\";\nif(\$s->check_eval)\n{\$s->target->jaddSlot(\$s->selected_method, \$s->methedit->Contents);}\n\n}");
$o->jaddSlot("clear_methods" => "sub{\n\t\$s->methlist->delete(0,\"end\");\n\t\$s->methedit->Contents(\"\");\n\t}");
$o->jaddSlot("sm" => "sub{\n\tmy \$method = \$_[1];\n\tmy \$data = \$_[2];\n\t#print \$method, \$data;\n\tmy \$fr = \$s->wh->Frame();\$fr->pack(-anchor=>'n', -side=>'top');\n\tmy \$text = \$fr -> Label(-text=>\$method);\$text->pack(-anchor=>\"w\", -side=>\"left\" );\n\t#\$s->in_handle(\$text);\n\tmy \$text2 = \$fr -> Scrolled('Text', -height=>10, -width=>80);\$text2->pack( -anchor=>\"e\", -side=>\"right\");\$text2->Contents(\$data);\n\t#\$s->res_handle(\$text2);\n\tmy \$button = \$fr->Button(-text=>\"Update\", -command=>sub {\$s->jaddSlot(\$method => \$text2->Contents);}); \$button->pack();\n\t}");
$o->jaddSlot("display_objs" => "sub{\n\t\t  foreach my \$o (sort(\@{\$s->oblist()}))\n\t\t{\$s->objectlist->insert(0,\$o->i_am_a)}}\n");
$o->jaddSlot("display" => "sub{\n\tforeach my \$method (sort(\$s->target->reflect->slotNames))\n        {\n      next if (\$method=~ /\\*\$/ );\n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->methlist->insert(0, \$method );\n        \n          }}\n\$s->window->configure(-title=>\"Editing object: \".\$s->target->i_am_a);\n\t\t  }\n\n\n");
$o->jaddSlot("callback_delete_method" => "sub{ \$s->target->reflect->deleteSlots(\$s->methlist->get(\$s->methlist->curselection))}\n\n\n");
$o->jaddSlot("callback_add_method" => "sub{\$s->clear_methods;\$s->target->jaddSlot(\$s->input_method_name->get, q!\"add your data or subroutine here.\\n  If you do add a sub, make sure the first 4 letters are sub{ to allow macros to detect it properly.\"!);\$s->display;}\n");
$o->jaddSlot("gstartup" => "sub{\nmy \$top = MainWindow->new; \n\t\$s->window(\$top);\n;\n\t\n\tmy \$fr = \$top->Frame;\$fr->pack(-anchor=>'n', -side=>'top', -fill=>'both', -expand=>1);\n\tmy \$objectlist = \$fr->Scrolled(\"Listbox\");\$objectlist->pack(-anchor=>'w', -side=>'left', -fill=>'both', -expand=>1);\n\t\$objectlist -> bind ('<<ListboxSelect>>', sub{\$s->clear_methods;\$s->target(\$s->find(\$objectlist->get(\$objectlist->curselection)));\$s->display;});\n\n\tmy \$methfr = \$fr->Frame;\$methfr->pack();\n\tmy \$methlist = \$methfr->Scrolled(\"Listbox\");\$methlist->pack(-anchor=>'w', -side=>'left', -fill=>'both', -expand=>1);\n\tmy \$newmeth = \$methfr->Entry; \$newmeth->pack();\n\tmy \$newmethbut = \$methfr->Button(-text=>\"Add method\", -command=>sub{\$s->callback_add_method});\$newmethbut->pack();\n\n\tmy \$delmethbut = \$methfr->Button(-text=>\"Delete method\", -command=>sub{\$s->callback_delete_method; \$s->display;});\$delmethbut->pack();\n\n\n\t\$methlist -> bind ('<<ListboxSelect>>', sub{\$s->display_slot(\$methlist->get(\$methlist->curselection))});\n\tmy \$meth = \$top->Scrolled(\"Text\");\$meth->pack(-anchor=>'n', -side=>'top', -fill=>'both');\n\tmy \$errbox = \$top->Scrolled(\"Text\", -height=>3);\$errbox->pack(-anchor=>'n', -side=>'top', -fill=>'both', -expand=>1);\n\tmy \$button = \$methfr->Button(-text=>\"Update\", -command=>sub {print \"Running update\"; \$s->update;}); \$button->pack();\n\t\$s->objectlist(\$objectlist);\n\t\$s->methlist(\$methlist);\n\t\$s->methedit(\$meth);\n\t\$s->errorbox(\$errbox);\n\t\$s->input_method_name(\$newmeth);\n\tprint \"Graphics started\\n\";\n\t}\n\n\n\n\n\n\n\n\n");
$o->jaddSlot("check_eval" => "sub{\n\t\n\tmy \$code = \t\$s->methedit->Contents;\n\t\$\@ = undef;\n\teval \$code;\n\tif (\$\@)\n\t\t{print \$\@, \"\\n\";\$s->errorbox->Contents(\$\@);\n\t\t\$s->window->Dialog(-text=>\$\@)->Show;\n\t\treturn undef;}\n\t\$s->errorbox->Contents(\"Your code compiled cleanly\");\n\treturn 1;\n\t}\n\n");
$o->jaddSlot("display_slot" => "sub{\n\tmy \$method = \$_[1];\n\t  \$s->selected_method(\$method);\n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$slot->{value};\n\tif (\$s->target->reflect->slotType(\$method) eq 'METHOD')\n\t\t{\$data = \$attr->{description};}\n        \$s->methedit->Contents( \$data );\n        \$s->errorbox->Contents(\"\");\n          }\n\$s->window->configure(-title=>\"Editing object: \".\$s->target->i_am_a.\" -> \".\$method);\n\t\t  }\n\n\n");



#Object: PrimaInheritenceEditor
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("selected_method" => "\"inspector\*\"");
$o->jaddSlot("objectlist" => "bless\(\ \{\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methlist" => "bless\(\ \{\
\ \ \"_Destroy_\"\ \=\>\ \[\
\ \ \ \ \"Delegates\"\
\ \ \]\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"Delegates\"\ \=\>\ \{\}\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.frame\"\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("methedit" => "bless\(\ \{\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame1\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("errorbox" => "bless\(\ \{\
\ \ \"packxsb\"\ \=\>\ 1\,\
\ \ \"packysb\"\ \=\>\ 1\,\
\ \ \"\-scrollbars\"\ \=\>\ \"sw\"\,\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame2\"\,\
\ \ \"pack_pending\"\ \=\>\ 0\
\}\,\ \'Tk\:\:Frame\'\ \)");
$o->jaddSlot("parent_name" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.entry\"\
\}\,\ \'Tk\:\:Entry\'\ \)");
$o->jaddSlot("parent_target" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.frame\.frame1\.entry1\"\
\}\,\ \'Tk\:\:Entry\'\ \)");
$o->jaddSlot("display_parent" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("window" => "bless\(\ \{\
\ \ \"_TkValue_\"\ \=\>\ \"\.\"\
\}\,\ \'MainWindow\'\ \)");
$o->jaddSlot("i_am_a" => "\"PrimaInheritenceEditor\"");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("widget_list_object" => "undef");
$o->jaddSlot("widget_list_slots" => "undef");
$o->jaddSlot("widget_input_method" => "undef");
$o->jaddSlot("widget_parent_target" => "undef");
$o->jaddSlot("widget_parent_name" => "undef");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("tagline" => "\"I\ add\ and\ remove\ parents\ from\ objects\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Inheritence\ Editor\"");
$o->jaddSlot("target" => "undef");
$o->jaddSlot("serial_number" => "17");
#Methods: 
$o->jaddSlot("update" => "sub{\n#eval{\nprint \"Updating \".\$s->target->i_am_a.\"'s method \".\$s->selected_method.\" with \". \$s->methedit->Contents .\"\\n\";\nif(\$s->check_eval)\n{\$s->target->jaddSlot(\$s->selected_method, \$s->methedit->Contents);}\n\n}");
$o->jaddSlot("check_eval" => "sub{\n\t\n\tmy \$code = \t\$s->methedit->Contents;\n\t\$\@ = undef;\n\teval \$code;\n\tif (\$\@)\n\t\t{print \$\@, \"\\n\";\$s->errorbox->Contents(\$\@);return undef;}\n\t\t\$s->errorbox->Contents(\"Your code compiled cleanly\");\n\treturn 1;\n\t}");
$o->jaddSlot("sm" => "sub{\n\tmy \$method = \$_[1];\n\tmy \$data = \$_[2];\n\t#print \$method, \$data;\n\tmy \$fr = \$s->wh->Frame();\$fr->pack(-anchor=>'n', -side=>'top');\n\tmy \$text = \$fr -> Label(-text=>\$method);\$text->pack(-anchor=>\"w\", -side=>\"left\" );\n\t;\n\tmy \$text2 = \$fr -> Scrolled('Text', -height=>10, -width=>80);\$text2->pack( -anchor=>\"e\", -side=>\"right\");\$text2->Contents(\$data);\n\t\n\tmy \$button = \$fr->Button(-text=>\"Update\", -command=>sub {\$s->jaddSlot(\$method => \$text2->Contents);}); \$button->pack();\n\t}");
$o->jaddSlot("set_parent" => "sub{\n\t\$s->target->reflect->addSlot(\n\t\t\$s->parent_name->get, \n\t\t\$s->objsearch(\$s->parent_target->get));}\n\n\n\n\n");
$o->jaddSlot("callback_slot_selected" => "sub{\$s->display_slot(\$_[1]);}");
$o->jaddSlot("clear_methods" => "sub{\n\t\n\t\$s->widget_list_slots->delete_items(0..\$s->widget_list_slots->count);\n\t#\$s->methedit->Contents(\"\");\n\t}");
$o->jaddSlot("display" => "sub{                                                        \n    \$s->clear_methods;\n\tforeach my \$method (\$s->target->reflect->slotNames('PARENT'))\n        {\n     # next unless ( \$method =~ /\\*\$/);\n        my (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        \$s->widget_list_slots->add_items(\$method );\n        \n          }}\n\t\t  }");
$o->jaddSlot("go" => "sub{\n\t\$s->target(\$s->find(\"GuiBrowser\"));\n\t\$s->gstartup;\n\t\$s->display_objs;\n\t#\$s->display;\n\t}");
$o->jaddSlot("callback_object_selected" => "sub{ \$s->target(\$s->find(\$_[1]));\n\$s->display;}");
$o->jaddSlot("display_objs" => "sub{\n  my \@names = map {\$_->i_am_a} \@{\$s->oblist()}; \n\t\t  foreach my \$o (sort(\@names))\n\t\t \n\t\t{\$s->widget_list_object->add_items(\$o)}}");
$o->jaddSlot("callback_set_parent" => "sub{\n\t\$s->target->reflect->addSlot(\n\t\t\$s->widget_parent_name->text, \n\t\t\$s->objsearch(\$s->widget_parent_target->text));\n                \$s->display;}");
$o->jaddSlot("display_slot" => "sub{\n\tmy \$method = \$_[1];\n\t  \$s->selected_method(\$method);\n\tif (\$s->target->reflect->slotType(\$method) eq 'PARENT')\n\t{\n        \tmy (\$val, \$slot) = \$s->target->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n       my \$target_obj= \$slot->{value};    \n\n        print \"Found target object \". \$target_obj->i_am_a. \"\\n\";\n\t\$s->widget_parent_target->text(\$target_obj->i_am_a);\n\t\$s->widget_parent_name->text(\$method);\n\$s->widget_window->text(\"Link: \".\$s->target->i_am_a.\" -> \".\$method . \" -> \" . \$target_obj->i_am_a);\n\n          }\n\t\t  }}");
$o->jaddSlot("callback_delete_link" => "sub{                                                              \n#  print \"Deleting \".\$s->widget_parent_name->text.\" from \".\$s->target->i_am_a.\"\\n\";\n  \$s->target()->reflect->deleteSlot(\$s->widget_parent_name->text);\n  \$s->display;       }");
$o->jaddSlot("gstartup" => "sub{\n\neval{\n        my \$w = new Prima::Window(\n                text     => 'Inheritence Editor',\n                size     => [ 600, 400],\n        );\n\t\$s->widget_window(\$w);               \n \n  \$s->widget_list_object(\n\t Prima::ListBox-> create(\n                items       => [],\n                onSelectItem     => sub {\n                        \$s->callback_object_selected(\$_[0]-> get_items( \$_[0]-> focusedItem));\n                },\n                owner => \$w,\n                pack => {anchor=>'n',side=>\"left\", fill=>'both',expand=>1},\n        )\n);\n\n  \$s->widget_list_slots(\n Prima::ListBox-> create(\n                items       => [],\n                onSelectItem     => sub {\n\$s->callback_slot_selected(\$_[0]-> get_items( \$_[0]-> focusedItem));\n                },\n                owner => \$w,\n                pack => {anchor=>'n',side=>'left', fill=>'both',expand=>1},\n)\n);\n\n\n\n\n\n\n\n\n\$s->widget_parent_name(\nPrima::InputLine->create (\n                owner=>\$w,\n                pack => {anchor=>'n', side=>'top'},    \n                text => 'slotName',\n)                );\n                      \n\n\$s->widget_parent_target(\nPrima::InputLine->create (\n                owner=>\$w,\n                pack => {anchor=>'n', side=>'top'},\n                text => 'slotTarget',\n)                \n);\n\n\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'Set Parent',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_set_parent},\n        );\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'Delete Link',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_delete_link},\n        );\n\n\n};\nprint \"\$\@\\n\";\n\t}");



#Object: OS
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"OS\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("tagline" => "\"I\ contain\ handy\ routines\ for\ dealing\ with\ the\ current\ OS\"");
$o->jaddSlot("serial_number" => "18");
#Methods: 
$o->jaddSlot("hostname" => "sub{ require Sys::Hostname; Sys::Hostname::hostname(); }\n\n\n");
$o->jaddSlot("program_name" => "sub{return \$0}");
$o->jaddSlot("uid" => "sub{return \$<}");
$o->jaddSlot("pid" => "sub{return \$\$;}");
$o->jaddSlot("executable_name" => "sub{return \$^X;}");
$o->jaddSlot("mswindows" => "sub{if (\$^O eq \"MSWin32\"){return 1;}return undef;}");
$o->jaddSlot("system_copy" => "sub{\n  if(\$s->mswindows) {return \"copy\";}\n  return \"cp\";\n  }");



#Object: Inspector
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("term" => "undef");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("i_am_a" => "\"Inspector\"");
$o->jaddSlot("current_object" => "undef");
$o->jaddSlot("serial_number" => "20");
#Methods: 
$o->jaddSlot("list_objects" => "sub{\n\tforeach my \$o (\@{\$_[0]->oblist})\n\t\t{print \$o->serial_number, \" : \", \$o->i_am_a, \" : \", \$o->tagline, \"\\n\";}}");
$o->jaddSlot("display_object" => "sub{\n\tmy \$obj = shift; my \$num = shift;\n\tmy \$self= \$obj;\n\tif(\$num>0){\$self = \$obj->sersearch(\$num);}\n\tforeach my \$method (\$self->reflect->slotNames)\n        {\n      \n        my (\$val, \$slot) = \$self->reflect->getSlot(\$method,\"rotated\");\n        if (\$slot){\n          \n        my \$attr = \$slot->{attribs};\n        my \$data = \$attr->{description};\n        print \$method , \":\", \$data, \"\\n\\n\";\n        \n          }}\n\t\t  }");
$o->jaddSlot("display_method" => "sub{\n\tmy \$self = shift;  my \$ser = shift; my \$meth = shift;\n\tmy \$obj = \$self->sersearch(\$ser);\n\tmy (\$val, \$slot) = \$obj->reflect->getSlot(\$method,\"rotated\");\n\tmy \$attr = \$slot->{attribs};\n    my \$code = \$attr->{description};\n\t\t\n\t\n}");
$o->jaddSlot("co" => "sub{ my \$f = \$_[0]->find(\$_[1]);\$_[0]->current_object(\$f);}");
$o->jaddSlot("startup" => "sub{if (!defined(\$_[0]->current_object)) {\$_[0]->current_object(\$_[0])}}");
$o->jaddSlot("tagline" => "sub{return \"I display objects\"}");



#Object: GUI
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"GUI\"");
$o->jaddSlot("requires" => "\[\
\ \ \"Tk\"\
\]");
$o->jaddSlot("tagline" => "\"I\ start\ the\ gui\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "21");
#Methods: 
$o->jaddSlot("start" => "sub{ my \$top = MainWindow->new; my \$button = \$top->Button(-text=>\"Hello\", -command=>sub {print \"Hello\\n\";}); \$button->place(-in=>\$top, -x=>0, -y=>0);MainLoop();}");



#Object: Memory
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Memory\"");
$o->jaddSlot("items" => "\[\]");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "22");
#Methods: 
$o->jaddSlot("remember" => "sub{\n\tmy \$self = shift;\n\tmy \@list = \@{\$self->items};\n\tmy \$item = shift;\n\tpush \@list, \$item;\n\t\$self->items=\\\@list;\n\t}");
$o->jaddSlot("known" => "sub{\n\tmy \$self = shift;\n\tmy \$search = shift;\n\tforeach my \$item (\@{\$self->items})\n\t\t{\n\t\t\tif ( \$item =~ /\$search/)\n\t\t\t\t{return 1;}\n\t\t}\n\treturn undef;\n\t}");
$o->jaddSlot("tagline" => "sub{return \"I store and retrieve data\"}");



#Object: PrimaObjectManager
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("widget_list_object" => "undef");
$o->jaddSlot("widget_list_methods" => "undef");
$o->jaddSlot("widget_input_method" => "undef");
$o->jaddSlot("widget_error_display" => "undef");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("widget_frameset" => "undef");
$o->jaddSlot("i_am_a" => "\"PrimaObjectManager\"");
$o->jaddSlot("widget_input_object_name" => "undef");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("tagline" => "\"I\ create\,\ delete\ and\ clone\ objects\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Object\ Manager\"");
$o->jaddSlot("selected_object" => "undef");
$o->jaddSlot("serial_number" => "23");
#Methods: 
$o->jaddSlot("update" => "sub{\n#eval{\nprint \"Updating \".\$s->selected_object->i_am_a.\"'s method \".\$s->selected_method.\" with \". \$s->widget_code->text .\"\\n\";\nif(\$s->check_eval)\n{\$s->selected_object->jaddSlot(\$s->selected_method, \$s->widget_code->text);}\n\n}\n");
$o->jaddSlot("callback_object_selected" => "sub{                              \n\n\tmy \$ob_name = \$_[1];\n\tprint \"Selected \$ob_name\\n\";\n\t\$s->selected_object(\$s->find(\$ob_name));\n         \n\$s->widget_window->text(\$s->selected_object->i_am_a);\n}");
$o->jaddSlot("go" => "sub{\n\t\$s->widget_window(\$s->find(\"PrimaBrowser\"));\n\t\$s->gstartup;\n\t\$s->display_objs;\n#\t\$s->display;\n\t}");
$o->jaddSlot("clear_objects" => "sub{\n\t\n\t\$s->widget_list_object->delete_items(0..\$s->widget_list_object->count);\n\t#\$s->methedit->Contents(\"\");\n\t}\n");
$o->jaddSlot("display_objs" => "sub{                                                           \n\$s->clear_objects;\n                  my \@names = map {\$_->i_am_a} \@{\$s->oblist()}; \n\t\t  foreach my \$o (sort(\@names))\n\t\t{\$s->widget_list_object->add_items(\$o)}}");
$o->jaddSlot("callback_delete_object" => "sub{\n     my \$name = \$s->selected_object->i_am_a;\n     \$s->delete_objects_by_name(\$name);      \n     \$s->display_objs;\n     \n     }");
$o->jaddSlot("callback_new_object" => "sub{\n     my \$name = \$s->widget_input_object_name->text;\n     my \$new_obj = \$s->fresh;                      \n     \$name = Dumper \$name;\n     \$new_obj->jaddSlot(\"i_am_a\", \$name);               \n     \$s->display_objs;\n     }");
$o->jaddSlot("callback_edit_object" => "sub{\n  my \$browser = \$s->find(\"PrimaBrowser\")->clone; \n  \$browser->go;  \n  \$browser->edit_object(\$s->selected_object);  \n  }");
$o->jaddSlot("callback_clone_object" => "sub{\n  my \$clone = \$s->selected_object->duplicate;  \n       my \$name = \$s->widget_input_object_name->text;\n       \$clone->i_am_a(\$name);\n  \$s->display_objs;\n  }");
$o->jaddSlot("gstartup" => "sub{\n\n use Prima qw(Application Buttons);\nuse Prima::Edit;\nuse Prima::Lists;\nuse Prima::InputLine;\nuse Prima::FrameSet;\n\n              \$s->widget_window(\n new Prima::Window(\n                       text     => \"Object Editor\",\n                       size     => [ 500, 400],\n\t\t\tonClose => sub{},\n               )\n\t);\n\n\n\n\n        \$s->widget_frameset(\nPrima::FrameSet->create(\n                frameSizes => [qw(211 20% 123 10% * 45% *)],\n                opaqueResize => 0,\n                frameProfiles => [ 0,0, { minFrameWidth => 123, maxFrameWidth => 123 }],\n                owner => \$s->widget_window,\n                pack => {anchor=>'n', side=>'top',fill=>'both', expand=>1},\n)        );\n\nmy \$w = \$s->widget_frameset;\n  \$s->widget_list_object(\n\t Prima::ListBox-> create(\n                items       => [],\n                onSelectItem     => sub {\n                        \$s->callback_object_selected(\$_[0]-> get_items( \$_[0]-> focusedItem));\n                },\n                owner => \$w,\n                pack => {anchor=>'n',side=>\"left\", fill=>'both',expand=>1},\n        )\n);\n\n\n\n\n\n\n\n\n\$s->widget_input_object_name(\nPrima::InputLine->create (\n                owner=>\$w,\n                pack => {anchor=>'n', side=>'top'},  \n                text => 'New Object Name',\n)                );\n\n\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'New Object',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_new_object},\n        );\n        Prima::Button-> new(\n                owner => \$w,\n                text  => 'Delete Object',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_delete_object},\n        );\n\n\n       Prima::Button-> new(\n                owner => \$w,\n                text  => 'Clone Object',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_clone_object},\n        );\n\n Prima::Button-> new(\n                owner => \$w,\n                text  => 'Edit Object',\n                pack  => {anchor=>'n', side=>'top'},\n                onClick => sub {\$s->callback_edit_object},\n        );\n     \n\n\n\n\n\t}");



#Object: ObjectReference
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("widget_edit" => "undef");
$o->jaddSlot("widget_notebook" => "undef");
$o->jaddSlot("widget_podview" => "undef");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("wikiData" => "undef");
$o->jaddSlot("current_page" => "\"Table\ of\ Contents\"");
$o->jaddSlot("tagline" => "\"I\ display\ information\ that\ is\ easy\ to\ edit\ and\ navigate\"");
$o->jaddSlot("i_am_a" => "\"ObjectReference\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Object\ Reference\"");
$o->jaddSlot("page_history" => "\[\]");
$o->jaddSlot("serial_number" => "24");
#Methods: 
$o->jaddSlot("go" => "sub{\n  my \@proto = \@{\$s->prototypes};     \n  \$s->wikiData({});\n  foreach my \$p ( \@proto )\n    {\n      \$s->wikiData->{\$p->i_am_a} = eval{\$p->documentation};\n      }\n   \$s->wikiStart;              \n   \$s->load_page(\"Table of Contents\");\n   }");
$o->jaddSlot("shutdown" => "sub{\$s->wikiData(undef)}");



#Object: NetImage
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"NetImage\"");
$o->jaddSlot("widget_window" => "undef");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("raw_data" => "undef");
$o->jaddSlot("url" => "\"http\:\/\/upload\.wikimedia\.org\/wikipedia\/commons\/7\/77\/Mergearticles\.png\"");
$o->jaddSlot("widget_image" => "undef");
$o->jaddSlot("loaded" => "undef");
$o->jaddSlot("tagline" => "\"I\ load\ images\ from\ the\ web\ and\ display\ them\ in\ a\ window\.\"");
$o->jaddSlot("serial_number" => "25");
#Methods: 
$o->jaddSlot("load" => "sub{\n\tmy \$url = \$_[1];\n\tif (\$url) {\$s->url(\$url);}\n\t\$url = \$s->url;\n\tprint \"Loading \$url\\n\";\n\trequire LWP::UserAgent;\n  my \$ua = LWP::UserAgent->new;\n  \$ua->agent(\"MyApp/0.1 \");\n\n  # Create a request\n  my \$req = HTTP::Request->new(POST => \$url);\n  \$req->content_type('application/x-www-form-urlencoded');\n  \$req->content('query=libwww-perl&mode=dist');\n\n  # Pass request to the user agent and get a response back\n  my \$res = \$ua->request(\$req);\n\n  # Check the outcome of the response\n  if (\$res->is_success) {\n\tmy \$content = \$res->content;\n      \$s->raw_data(\$content);                \n      \$s->loaded (\$s->url);\n  }\n  else {\n      print \$res->status_line, \"\\n\";\n  }\n}");
$o->jaddSlot("realise" => "sub{                        \nif (\$s->loaded ne \$s->url){\$s->load}\n                  eval{\n                  \n                \nmy \$pic = \$s->raw_data;\nmy \$fh;\nopen (\$fh, \"+<\", \\\$pic);\nmy \$i = Prima::Image->load(\$fh);                  \nreturn \"\$\@\" unless \$i;\n\$s->widget_image(\$i);      \n          \n}                                   }");
$o->jaddSlot("shutdown" => "sub{\n\$s->loaded(undef);\n\$s->raw_data(undef);\n}");
$o->jaddSlot("show" => "sub{                     \nif (\$_[1]){\$s->url(\$_[1])};               \n\$s->load;\n#\$s->realise;         \n\nif (\$s->loaded ne \$s->url){\$s->load}\n                  eval{\n                  \n                \nmy \$pic = \$s->raw_data;\nmy \$fh;\nopen (\$fh, \"+<\", \\\$pic);\nmy \$i = Prima::Image->load(\$fh);                  \nreturn \"\$\@\" unless \$i;\n\$s->widget_image(\$i);      \n          \n}   ;\n                                 \nif(\$s->widget_image){    \n             \$s->widget_window(\n new Prima::Window(\n                       text     => \"Object Editor\",\n                       size     => [ 400, 300],\n\t\t\tonClose => sub{},\n               )\n\t);               \n\n\$s->widget_window->insert(\nImageViewer =>\n  owner => \$s->widget_window,\n  image=>\$s->widget_image,   \n  pack => {fill=>'both', expand=>1},\n);        \n}}\n                     ");



#Object: Keyboard_input_object
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Keyboard_input_object\"");
$o->jaddSlot("Lobby" => "undef");
$o->jaddSlot("serial_number" => "26");
#Methods: 
$o->jaddSlot("get_input" => "sub{\nprint \"Starting keyboard input\\n\";\nmy \$term  = new Term::ReadLine 'Live Objects';\n  my \$prompt = \"LiveObjects >\";\n  #my \$OUT = \$term->OUT || \\*STDOUT;\n  \n  while ( defined (\$_ = \$term->readline(\$prompt)) ) {\n    #my \$res = eval(\$_);\n\tif (/^\\./) {s/^\\./\\\$_[0]->current_object->/;}\n\t\$_ = 'my \$s = \$_[0];'.\$_;\n\t#print \"Current object: \".\$_[0]->current_object.\"\\n\";\n\tmy \$com = \$_[0]->objsearch(\"Command_executor\");\n\tprint \"Evalling \$_\\n\";\n\t\$com->execute(\$_);\n\n    #warn \$\@ if \$\@;\n    #print \$OUT \$res, \"\\n\" unless \$\@;\n    \$term->addhistory(\"test history\");\n  }\n  }");
$o->jaddSlot("get_input_old" => "sub{\nprint \"Command>\";\nmy \$c = <>;\nmy \$com = \$_[0]->objsearch(\"Command_executor\");\n\$com->execute(\$c);\n\$_[0]->get_input;\n}");
$o->jaddSlot("tagline" => "sub{return \"I get input from the keyboard and execute it\"}");



#Object: Lobby
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Lobby\"");
$o->jaddSlot("serial_number" => "27");
#Methods: 
$o->jaddSlot("tagline" => "sub{return \"I need a tagline\"}");



#Object: Shutdown
$o = $bootObj->fresh;
#Fields:
$o->jaddSlot("i_am_a" => "\"Shutdown\"");
$o->jaddSlot("tagline" => "\"I\ shutdown\ the\ system\"");
$o->jaddSlot("isApplication" => "\"add\ your\ data\ or\ subroutine\ here\.\\n\ \ If\ you\ do\ add\ a\ sub\,\ make\ sure\ the\ first\ 4\ letters\ are\ sub\{\ to\ allow\ macros\ to\ detect\ it\ properly\.\"");
$o->jaddSlot("humanName" => "\"Shutdown\"");
$o->jaddSlot("serial_number" => "28");
#Methods: 
$o->jaddSlot("go" => "sub{ \$s->snapshot; }");



sub object_link {my $child = shift;  my $linkname = shift;  my $parent = shift;
      $child = $bootObj->sersearch($child);
      $parent = $bootObj->sersearch($parent);
      print "Linking child $child to parent $parent via link $linkname
";
      $child->reflect->addSlot($linkname => $parent);
    }

object_link(1, 'UniversalTraits*', 2);
object_link(1, 'bootStrap*', 19);
object_link(2, 'bootStrap*', 19);
object_link(3, 'UniversalTraits*', 2);
object_link(3, 'bootStrap*', 19);
object_link(4, 'bootStrap*', 19);
object_link(4, 'UniversalTraits*', 2);
object_link(5, 'UniversalTraits*', 2);
object_link(5, 'bootStrap*', 19);
object_link(6, 'UniversalTraits*', 2);
object_link(6, 'bootStrap*', 19);
object_link(7, 'UniversalTraits*', 2);
object_link(7, 'bootStrap*', 19);
object_link(7, 'inspector*', 20);
object_link(8, 'UniversalTraits*', 2);
object_link(8, 'bootStrap*', 19);
object_link(9, 'UniversalTraits*', 2);
object_link(9, 'bootStrap*', 19);
object_link(10, 'UniversalTraits*', 2);
object_link(10, 'bootStrap*', 19);
object_link(11, 'UniversalTraits*', 2);
object_link(11, 'bootStrap*', 19);
object_link(12, 'bootStrap*', 19);
object_link(12, 'UniversalTraits*', 2);
object_link(13, 'UniversalTraits*', 2);
object_link(13, 'bootStrap*', 19);
object_link(14, 'UniversalTraits*', 2);
object_link(14, 'bootStrap*', 19);
object_link(14, 'wikiTrait*', 12);
object_link(15, 'UniversalTraits*', 2);
object_link(15, 'bootStrap*', 19);
object_link(16, 'UniversalTraits*', 2);
object_link(16, 'bootStrap*', 19);
object_link(16, 'wikiTrait*', 12);
object_link(17, 'UniversalTraits*', 2);
object_link(17, 'bootStrap*', 19);
object_link(17, 'target', 16);
object_link(18, 'UniversalTraits*', 2);
object_link(18, 'bootStrap*', 19);
object_link(19, 'bootObj', 19);
object_link(20, 'current_object', 20);
object_link(20, 'UniversalTraits*', 2);
object_link(20, 'bootStrap*', 19);
object_link(21, 'UniversalTraits*', 2);
object_link(21, 'bootStrap*', 19);
object_link(22, 'UniversalTraits*', 2);
object_link(22, 'bootStrap*', 19);
object_link(22, 'test*', 20);
object_link(23, 'UniversalTraits*', 2);
object_link(23, 'bootStrap*', 19);
object_link(23, 'selected_object', 4);
object_link(24, 'UniversalTraits*', 2);
object_link(24, 'bootStrap*', 19);
object_link(24, 'wikiTrait*', 12);
object_link(25, 'UniversalTraits*', 2);
object_link(25, 'bootStrap*', 19);
object_link(26, 'UniversalTraits*', 2);
object_link(26, 'bootStrap*', 19);
object_link(27, 'UniversalTraits*', 2);
object_link(27, 'bootStrap*', 19);
object_link(27, 'inspector*', 20);
object_link(28, 'bootStrap*', 23);
$bootObj->boot;